fix: Don't mangle class names in production
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ManifestPlugin = require('webpack-manifest-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
||||
commonWebpackConfig = require('./webpack.config');
|
||||
|
||||
@@ -15,8 +16,29 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
||||
filename: 'bundle.[hash].js',
|
||||
publicPath: '/static/',
|
||||
},
|
||||
stats: "normal"
|
||||
stats: "normal",
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
ecma: undefined,
|
||||
parse: {},
|
||||
compress: {},
|
||||
mangle: true, // Note `mangle.properties` is `false` by default.
|
||||
module: false,
|
||||
output: null,
|
||||
toplevel: false,
|
||||
nameCache: null,
|
||||
ie8: false,
|
||||
keep_classnames: undefined,
|
||||
keep_fnames: true,
|
||||
safari10: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
productionWebpackConfig.plugins = [
|
||||
...productionWebpackConfig.plugins,
|
||||
new ManifestPlugin()
|
||||
|
||||
Reference in New Issue
Block a user