You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
const {merge} = require('webpack-merge'); |
|
const TerserPlugin = require('terser-webpack-plugin'); |
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); |
|
const common = require('./webpack.common.js'); |
|
|
|
module.exports = merge(common, { |
|
mode: 'production', |
|
optimization: { |
|
minimize: true, |
|
minimizer: [ |
|
new TerserPlugin(), |
|
new CssMinimizerPlugin({ |
|
minimizerOptions: { |
|
preset: ['default', { |
|
calc: true, |
|
convertValues: true, |
|
discardComments: { |
|
removeAll: true |
|
}, |
|
discardDuplicates: true, |
|
discardEmpty: true, |
|
mergeRules: true, |
|
normalizeCharset: true, |
|
reduceInitial: true, // This is since IE11 does not support the value Initial |
|
svgo: true |
|
}], |
|
} |
|
}), |
|
], |
|
splitChunks: { |
|
cacheGroups: { |
|
main: { |
|
chunks: 'all', |
|
name: 'site', |
|
test: 'main', |
|
enforce: true |
|
} |
|
} |
|
} |
|
}, |
|
performance: {hints: false} |
|
});
|
|
|