Updated Spine webpack config to use Terser

This commit is contained in:
Richard Davey 2022-01-21 17:33:16 +00:00
parent ed497bb700
commit 368b37b916
3 changed files with 24 additions and 21 deletions

View file

@ -1,7 +1,7 @@
'use strict';
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
@ -53,18 +53,19 @@ module.exports = {
optimization: {
minimizer: [
new UglifyJSPlugin({
new TerserPlugin({
include: /\.min\.js$/,
parallel: true,
sourceMap: false,
uglifyOptions: {
extractComments: false,
terserOptions: {
format: {
comments: false
},
compress: true,
ie8: false,
ecma: 5,
output: {comments: false},
warnings: false
},
warningsFilter: () => false
}
})
]
},

View file

@ -1,7 +1,7 @@
'use strict';
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
@ -53,18 +53,19 @@ module.exports = {
optimization: {
minimizer: [
new UglifyJSPlugin({
new TerserPlugin({
include: /\.min\.js$/,
parallel: true,
sourceMap: false,
uglifyOptions: {
extractComments: false,
terserOptions: {
format: {
comments: false
},
compress: true,
ie8: false,
ecma: 5,
output: {comments: false},
warnings: false
},
warningsFilter: () => false
}
})
]
},

View file

@ -1,7 +1,7 @@
'use strict';
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
@ -53,18 +53,19 @@ module.exports = {
optimization: {
minimizer: [
new UglifyJSPlugin({
new TerserPlugin({
include: /\.min\.js$/,
parallel: true,
sourceMap: false,
uglifyOptions: {
extractComments: false,
terserOptions: {
format: {
comments: false
},
compress: true,
ie8: false,
ecma: 5,
output: {comments: false},
warnings: false
},
warningsFilter: () => false
}
})
]
},