Updating webpack for font

This commit is contained in:
2020-05-31 05:22:10 +01:00
parent 16a1fe41fd
commit c10b7b0026
6 changed files with 33 additions and 6 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -9,13 +9,27 @@
"js": "2.lazyload.1168fc21175de558d316.min.js" "js": "2.lazyload.1168fc21175de558d316.min.js"
}, },
"main": { "main": {
"css": "main.8d8f975136c9cc17a7c6.min.css", "css": "main.d1dadd1111775dfca1b1.min.css",
"js": "main.5f5dabd521a484e6869a.min.js" "js": "main.0de3305519cc1270072a.min.js"
}, },
"vendors~app": { "vendors~app": {
"js": "4.vendors~app.5fe693a38fabc29c6181.min.js" "js": "4.vendors~app.5fe693a38fabc29c6181.min.js"
}, },
"vendors~bootstrap": { "vendors~bootstrap": {
"js": "5.vendors~bootstrap.ebc6358ec2d8424a6fb0.min.js" "js": "5.vendors~bootstrap.ebc6358ec2d8424a6fb0.min.js"
},
"": {
"ttf": [
"1ca584c47210c1b86d10754c325ad62b.ttf",
"2dcef7a784f8318ced92b5b4047fa1f5.ttf",
"3a17dce21bdbd88122a2112e60b23a2f.ttf",
"b46321476d5515714322049f81d5fb3f.ttf",
"bcb8e5ce3b17c1e244d2725cf8e55234.ttf",
"df62a7a90f92924e3a685b68d5a49361.ttf"
],
"otf": [
"21c63a34ea5e74584751e3b6618d29de.otf",
"cf6ea537acbd7e39208334261f95783e.otf"
]
} }
} }

View File

@@ -16,6 +16,7 @@
"bootstrap": "^4.5.0", "bootstrap": "^4.5.0",
"clean-webpack-plugin": "^3.0.0", "clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.5.3", "css-loader": "^3.5.3",
"file-loader": "^6.0.0",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"mini-css-extract-plugin": "^0.9.0", "mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",

View File

@@ -8,7 +8,7 @@ module.exports = {
devtool: "source-map", devtool: "source-map",
entry: path.resolve(__dirname, "src/main.js"), entry: path.resolve(__dirname, "src/main.js"),
output: { output: {
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, "static/dist"),
}, },
module: { module: {
rules: [ rules: [
@@ -21,7 +21,7 @@ module.exports = {
}, },
plugins: [ plugins: [
new CleanWebpackPlugin({ new CleanWebpackPlugin({
cleanAfterEveryBuildPatterns: ["dist/*"], cleanAfterEveryBuildPatterns: ["static/dist/*"],
}), }),
new AssetsPlugin({ new AssetsPlugin({
filename: "assets.json", filename: "assets.json",

View File

@@ -6,7 +6,7 @@ const TerserPlugin = require("terser-webpack-plugin");
const CssMinimizer = require("optimize-css-assets-webpack-plugin"); const CssMinimizer = require("optimize-css-assets-webpack-plugin");
const PurgeCssPlugin = require("purgecss-webpack-plugin"); const PurgeCssPlugin = require("purgecss-webpack-plugin");
const glob = require("glob"); const glob = require("glob");
const path = require("path") const path = require("path");
module.exports = merge(common, { module.exports = merge(common, {
mode: "production", mode: "production",
@@ -14,7 +14,7 @@ module.exports = merge(common, {
output: { output: {
filename: "[name].[contenthash].min.js", filename: "[name].[contenthash].min.js",
chunkFilename: "[id].[name].[contenthash].min.js", chunkFilename: "[id].[name].[contenthash].min.js",
publicPath: "dist/", publicPath: "/dist/",
}, },
module: { module: {
rules: [ rules: [
@@ -28,6 +28,10 @@ module.exports = merge(common, {
"sass-loader", "sass-loader",
], ],
}, },
{
test: /\.(ttf|otf)$/,
use: ["file-loader"],
},
], ],
}, },
plugins: [ plugins: [

View File

@@ -2537,6 +2537,14 @@ figgy-pudding@^3.5.1:
resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e"
integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==
file-loader@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.0.0.tgz#97bbfaab7a2460c07bcbd72d3a6922407f67649f"
integrity sha512-/aMOAYEFXDdjG0wytpTL5YQLfZnnTmLNjn+AIrJ/6HVnTfDqLsVKUUwkDf4I4kgex36BvjuXEn/TX9B/1ESyqQ==
dependencies:
loader-utils "^2.0.0"
schema-utils "^2.6.5"
file-uri-to-path@1.0.0: file-uri-to-path@1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"