diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index 266081f..e3a197b 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -1,8 +1,26 @@ const { merge } = require('webpack-merge'); const common = require('../webpack.common.js'); const webpack = require('webpack'); +const TerserPlugin = require('terser-webpack-plugin'); module.exports = merge(common, { mode: 'production', - devtool: 'hidden-source-map' + devtool: 'hidden-source-map', + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + terserOptions: { + compress: { + drop_console: true + } + } + }) + ] + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production') + }) + ] });