-
Notifications
You must be signed in to change notification settings - Fork 731
/
webpack.dev.js
43 lines (40 loc) · 1.15 KB
/
webpack.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { merge } = require("webpack-merge");
const CopyPlugin = require("copy-webpack-plugin");
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
const AssetJsonPlugin = require("./webpack/asset-json-plugin");
const common = require("./webpack.common.js");
const entrypoints = require("./webpack/entrypoints");
const entrypointsHtml = require("./webpack/entrypoints-html");
const assetModuleFilename = "[name].[contenthash][ext]";
module.exports = merge(common, {
entry: entrypoints,
plugins: [
...entrypointsHtml,
new CopyPlugin({
patterns: [
{
from: "node_modules/@mozilla-protocol/core/protocol/img/icons/**",
to: assetModuleFilename,
},
{ from: "kitsune/*/static/**/img/**", to: assetModuleFilename },
],
}),
new ImageMinimizerPlugin({
minimizer: {
implementation: ImageMinimizerPlugin.imageminMinify,
options: {
plugins: ["optipng", "svgo"],
},
},
}),
new AssetJsonPlugin(),
],
optimization: {
splitChunks: {
chunks: "all",
},
},
output: {
assetModuleFilename: assetModuleFilename,
},
});