-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.prod.cjs
More file actions
28 lines (26 loc) · 828 Bytes
/
webpack.prod.cjs
File metadata and controls
28 lines (26 loc) · 828 Bytes
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
const { merge } = require("webpack-merge");
const common = require("./webpack.common.cjs");
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const path = require("path");
const TerserJSPlugin = require("terser-webpack-plugin");
const HtmlMinimizerPlugin = require("html-minimizer-webpack-plugin");
module.exports = merge(common, {
mode: "production",
optimization: {
usedExports: true,
minimizer: [
new TerserJSPlugin({
terserOptions: { compress: true, mangle: { properties: true } },
}),
new HtmlMinimizerPlugin({minimizerOptions: { minifyJS: false}})
],
minimize: true,
},
output: {
path: path.join(process.cwd(), "dist"),
},
plugins: [
new BundleAnalyzerPlugin({ openAnalyzer: false, analyzerMode: "static" }),
],
});