diff --git a/package.json b/package.json index ddb6f7ecd..972585779 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "source-map-loader": "^4.0.1", "standard-version": "^9.5.0", "style-loader": "3.3.3", - "terser-webpack-plugin": "^5.3.9", + "terser-webpack-plugin": "^5.3.10", "typescript": "^5.2.2", "webpack": "^5.88.2", "webpack-cli": "^5.1.4", diff --git a/webpack.config.js b/webpack.config.js index aa05ba421..ab3896972 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,6 +3,7 @@ const path = require('path'); const CopyPlugin = require('copy-webpack-plugin'); const packageData = require('./package.json'); const chalk = require('chalk'); +const TerserPlugin = require('terser-webpack-plugin'); module.exports = (env, { mode }) => { const { playerType } = env; @@ -26,6 +27,9 @@ module.exports = (env, { mode }) => { target: 'web', entry: './src/index.ts', devtool: 'source-map', + optimization: { + minimizer: [new TerserPlugin({terserOptions: {mangle: {reserved: ['module']}}})], + }, module: { rules: [ { diff --git a/yarn.lock b/yarn.lock index 43cf1a83d..82e843d5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5559,7 +5559,7 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -terser-webpack-plugin@^5.3.7, terser-webpack-plugin@^5.3.9: +terser-webpack-plugin@^5.3.10, terser-webpack-plugin@^5.3.7: version "5.3.10" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==