Remove console.log from production build

This commit is contained in:
Bartek Fabiszewski 2019-12-30 14:01:56 +01:00
parent 666410b653
commit 684a77f814

View File

@ -1,9 +1,24 @@
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = merge(common, { module.exports = merge(common, {
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: 'source-map',
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true,
terserOptions: {
compress: {
pure_funcs: [ 'console.log' ]
}
}
})
]
},
module: { module: {
rules: [ rules: [
{ {