Replace from uglifyjs to terser (#10956)
This commit is contained in:
parent
7c682c4825
commit
da38c0a6b8
3 changed files with 51 additions and 29 deletions
|
@ -5,7 +5,7 @@ const { URL } = require('url');
|
|||
const merge = require('webpack-merge');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
const OfflinePlugin = require('offline-plugin');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const CompressionPlugin = require('compression-webpack-plugin');
|
||||
const { output } = require('./configuration');
|
||||
const sharedConfig = require('./shared');
|
||||
|
@ -33,20 +33,10 @@ module.exports = merge(sharedConfig, {
|
|||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
new TerserPlugin({
|
||||
cache: true,
|
||||
parallel: true,
|
||||
sourceMap: true,
|
||||
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false,
|
||||
},
|
||||
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
@ -64,6 +54,7 @@ module.exports = merge(sharedConfig, {
|
|||
}),
|
||||
new OfflinePlugin({
|
||||
publicPath: output.publicPath, // sw.js must be served from the root to avoid scope issues
|
||||
safeToUseOptionalCaches: true,
|
||||
caches: {
|
||||
main: [':rest:'],
|
||||
additional: [':externals:'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue