forked from adrian-rivarola/shameful-murder-desperadoes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
29 lines (28 loc) · 987 Bytes
/
webpack.prod.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
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const InlineChunkHtmlPlugin = require("./inline-chunk-html-plugin");
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: {
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 InlineChunkHtmlPlugin(HtmlWebpackPlugin, [".js"]),
new BundleAnalyzerPlugin({ openAnalyzer: false, analyzerMode: "static" }),
],
});