forked from digidem/mapeo-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
31 lines (30 loc) · 847 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
30
31
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = merge(common, {
mode: 'production',
devtool: process.env.DEBUG_PROD === 'true' ? 'source-map' : 'none',
plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
}),
new BundleAnalyzerPlugin({
analyzerMode:
process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
openAnalyzer: process.env.OPEN_ANALYZER === 'true'
})
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
sourceMap: true,
cache: true,
extractComments: false
})
]
}
})