diff --git a/package.json b/package.json index f61dc8794..d4762508e 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,7 @@ "ts-loader": "^8.3.0", "ts-node": "^10.0.0", "wait-on": "^5.3.0", - "webpack-cli": "^4.7.2" + "webpack-cli": "^4.7.2", + "webpack-node-externals": "^3.0.0" } } diff --git a/webpack.main.js b/webpack.main.js index 5dd8c4e45..5376e4388 100644 --- a/webpack.main.js +++ b/webpack.main.js @@ -1,5 +1,7 @@ const path = require('path') +const nodeExternals = require('webpack-node-externals') + const common = (_ /* env */, argv) => ({ output: { path: path.resolve(__dirname, 'public'), @@ -38,7 +40,8 @@ const main = (env, arg) => { entry: { electron: './src/main/electron.ts' }, - target: 'electron-main' + target: 'electron-main', + externals: [nodeExternals()] }) } diff --git a/yarn.lock b/yarn.lock index 2ddf06708..8b68eefe9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19346,6 +19346,11 @@ webpack-merge@^5.7.3: clone-deep "^4.0.1" wildcard "^2.0.0" +webpack-node-externals@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz#1a3407c158d547a9feb4229a9e3385b7b60c9917" + integrity sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ== + webpack-sources@^1.1.0, webpack-sources@^1.3.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"