diff options
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/webpack.config.js b/webpack.config.js index a9329712..a2da5786 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,6 @@ const ESLintPlugin = require('eslint-webpack-plugin'); const CopyPlugin = require('copy-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); module.exports = (env, argv) => { const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'; @@ -41,10 +42,32 @@ module.exports = (env, argv) => { } }; if (dev) { - config.plugins.push(new ESLintPlugin({ files: 'src/main/assets', lintDirtyModulesOnly: true, failOnWarning: false, failOnError: true, fix: false })); + config.plugins.push( + new ESLintPlugin({ + files: 'src/main/assets', + lintDirtyModulesOnly: true, + failOnWarning: false, + failOnError: true, + fix: false + })); } config.optimization = { - minimize: !dev + minimize: !dev, + minimizer: [ + new TerserPlugin({ + minify: TerserPlugin.esbuildMinify, + // `terserOptions` options will be passed to `esbuild` + // Link to options - https://esbuild.github.io/api/#minify + // Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use: + // terserOptions: { + // minify: false, + // minifyWhitespace: true, + // minifyIdentifiers: false, + // minifySyntax: true, + // }, + terserOptions: {}, + }), + ] }; return config; }; |