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

View file

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

View file

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