forked from anttihaavikko/js13k-2024
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.prod.js
26 lines (25 loc) · 1022 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
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' }),
]
});