From b2b5a6a3de951a5b4527ee22a8feccfa2cc9b25b Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 23 Jun 2020 14:57:08 -0700 Subject: [PATCH] chore: minify internal JS code (#24252) --- build/webpack/webpack.config.base.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/webpack/webpack.config.base.js b/build/webpack/webpack.config.base.js index 62cb075ff0..f507ea11d2 100644 --- a/build/webpack/webpack.config.base.js +++ b/build/webpack/webpack.config.base.js @@ -1,6 +1,7 @@ const fs = require('fs') const path = require('path') const webpack = require('webpack') +const TerserPlugin = require('terser-webpack-plugin'); const electronRoot = path.resolve(__dirname, '../..') @@ -77,7 +78,7 @@ module.exports = ({ return ({ mode: 'development', - devtool: 'inline-source-map', + devtool: false, entry, target: alwaysHasNode ? 'node' : 'web', output: { @@ -117,6 +118,17 @@ module.exports = ({ // one of our renderer bundles should import it from the 'timers' package setImmediate: false, }, + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + terserOptions: { + keep_classnames: true, + keep_fnames: true, + }, + }), + ], + }, plugins: [ new AccessDependenciesPlugin(), ...(targetDeletesNodeGlobals ? [