forked from helxplatform/helx-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
38 lines (37 loc) · 1.08 KB
/
webpack.prod.config.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
32
33
34
35
36
37
38
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const { merge } = require('webpack-merge')
const { baseConfig, paths, createBabelLoader, createCopyPlugin } = require('./webpack.base.config.js');
console.log("Creating optimized production build. This may take a while...")
module.exports = merge(baseConfig, {
mode: 'production',
entry: {
main: paths.entryPoint,
vendor: ['react', 'react-dom', 'antd']
},
output: {
publicPath: '/static/frontend/'
},
devtool: false,
module: {
rules: [ createBabelLoader({ isDevelopment: false }) ]
},
plugins: [
new webpack.EnvironmentPlugin({
'NODE_ENV': 'production'
}),
createCopyPlugin({ isDevelopment: false })
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin(),
new CssMinimizerPlugin()
],
splitChunks: {
chunks: 'all'
},
runtimeChunk: true
}
})