build: minify internal JS code (#24273)

* chore: minify internal JS code

* chore: upgrade webpack

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
trop[bot]
2020-06-25 21:19:56 -07:00
committed by GitHub
parent 42efa2ad04
commit 1e38fb1a8d
3 changed files with 378 additions and 302 deletions

View File

@@ -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, '../..')
@@ -94,7 +95,7 @@ module.exports = ({
return ({
mode: 'development',
devtool: 'inline-source-map',
devtool: false,
entry,
target: alwaysHasNode ? 'node' : 'web',
output: {
@@ -134,6 +135,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 ? [

View File

@@ -62,8 +62,8 @@
"ts-loader": "^6.0.2",
"ts-node": "^6.0.3",
"typescript": "^3.5.2",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2"
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
},
"private": true,
"scripts": {
@@ -144,4 +144,4 @@
"dependencies": {
"@types/temp": "^0.8.34"
}
}
}

660
yarn.lock

File diff suppressed because it is too large Load Diff