forked from OpenStackweb/summit-admin
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
38 lines (36 loc) · 1.18 KB
/
webpack.prod.js
File metadata and controls
38 lines (36 loc) · 1.18 KB
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
const TerserJSPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
module.exports = merge(common, {
mode: 'production',
output: {
filename: '[name]_[contenthash].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
pathinfo: false
},
optimization: {
minimize: true,
minimizer: [
new TerserJSPlugin({
parallel: true,
terserOptions: {
mangle: { reserved: ['Lock','SuperTokensLock','GET_TOKEN_SILENTLY_LOCK_KEY'] },
compress: {inline: false}
}
}),
new CssMinimizerPlugin(),
],
splitChunks: {
chunks: 'all'
}
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
}),
]
});