From 368b37b916b6d9a2e6f50dba13053017682f7739 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Fri, 21 Jan 2022 17:33:16 +0000 Subject: [PATCH] Updated Spine webpack config to use Terser --- plugins/spine/webpack.auto.dist.config.js | 15 ++++++++------- plugins/spine/webpack.canvas.dist.config.js | 15 ++++++++------- plugins/spine/webpack.webgl.dist.config.js | 15 ++++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/plugins/spine/webpack.auto.dist.config.js b/plugins/spine/webpack.auto.dist.config.js index 655ab50d6..c4342e3cf 100644 --- a/plugins/spine/webpack.auto.dist.config.js +++ b/plugins/spine/webpack.auto.dist.config.js @@ -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 + } }) ] }, diff --git a/plugins/spine/webpack.canvas.dist.config.js b/plugins/spine/webpack.canvas.dist.config.js index 4efa409f3..3913af1c2 100644 --- a/plugins/spine/webpack.canvas.dist.config.js +++ b/plugins/spine/webpack.canvas.dist.config.js @@ -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 + } }) ] }, diff --git a/plugins/spine/webpack.webgl.dist.config.js b/plugins/spine/webpack.webgl.dist.config.js index cd86822b6..b18747908 100644 --- a/plugins/spine/webpack.webgl.dist.config.js +++ b/plugins/spine/webpack.webgl.dist.config.js @@ -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 + } }) ] },