2020-08-29 14:33:08 +02:00
|
|
|
const { merge } = require('webpack-merge');
|
2019-11-29 16:53:50 +01:00
|
|
|
const common = require('./webpack.common.js');
|
2019-12-30 14:01:56 +01:00
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
2019-11-29 16:53:50 +01:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: 'production',
|
2019-12-19 23:04:12 +01:00
|
|
|
devtool: 'source-map',
|
2019-12-30 14:01:56 +01:00
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
|
|
|
parallel: true,
|
|
|
|
terserOptions: {
|
|
|
|
compress: {
|
|
|
|
pure_funcs: [ 'console.log' ]
|
2020-01-11 16:15:22 +01:00
|
|
|
},
|
|
|
|
output: {
|
2020-08-29 14:33:08 +02:00
|
|
|
comments: false
|
2019-12-30 14:01:56 +01:00
|
|
|
}
|
2020-01-11 16:15:22 +01:00
|
|
|
},
|
|
|
|
extractComments: false
|
2019-12-30 14:01:56 +01:00
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
2019-11-29 16:53:50 +01:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [ '@babel/preset-env' ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|