Skip to content

Commit 86e4a96

Browse files
chore: minify internal JS code (electron#24272)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
1 parent e059ae7 commit 86e4a96

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build/webpack/webpack.config.base.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require('fs')
22
const path = require('path')
33
const webpack = require('webpack')
4+
const TerserPlugin = require('terser-webpack-plugin');
45

56
const electronRoot = path.resolve(__dirname, '../..')
67

@@ -77,7 +78,7 @@ module.exports = ({
7778

7879
return ({
7980
mode: 'development',
80-
devtool: 'inline-source-map',
81+
devtool: false,
8182
entry,
8283
target: alwaysHasNode ? 'node' : 'web',
8384
output: {
@@ -117,6 +118,17 @@ module.exports = ({
117118
// one of our renderer bundles should import it from the 'timers' package
118119
setImmediate: false,
119120
},
121+
optimization: {
122+
minimize: true,
123+
minimizer: [
124+
new TerserPlugin({
125+
terserOptions: {
126+
keep_classnames: true,
127+
keep_fnames: true,
128+
},
129+
}),
130+
],
131+
},
120132
plugins: [
121133
new AccessDependenciesPlugin(),
122134
...(targetDeletesNodeGlobals ? [

0 commit comments

Comments
 (0)