Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Try webpack-node-externals
Browse files Browse the repository at this point in the history
  • Loading branch information
veado committed Jul 21, 2021
1 parent 2082d28 commit 8882ea9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 4 additions & 1 deletion webpack.main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path')

const nodeExternals = require('webpack-node-externals')

const common = (_ /* env */, argv) => ({
output: {
path: path.resolve(__dirname, 'public'),
Expand Down Expand Up @@ -38,7 +40,8 @@ const main = (env, arg) => {
entry: {
electron: './src/main/electron.ts'
},
target: 'electron-main'
target: 'electron-main',
externals: [nodeExternals()]
})
}

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8882ea9

Please sign in to comment.