Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save transitive-bullshit/7346157247a31d562723174c469fb5b4 to your computer and use it in GitHub Desktop.
Save transitive-bullshit/7346157247a31d562723174c469fb5b4 to your computer and use it in GitHub Desktop.
Webpack + Electron Question
I'm running into an issues with the latest version of Electron + Webpack.
If I try to use the 'electron-renderer' target, webpack compilation fails because it attempts to use native node dependencies from one of my npm modules let's call it "child-module".
{
// ...
target: 'electron-renderer'
}
child-module's package.json:
{
"dependencies": {
...
},
"browser": {
"zlib": "browserify-zlib",
"bluebird": false,
"ws": false
}
}
If I change my webpack target to "web", everything works fine as webpack is smart enough to use the browser excludes from child-module's package.json.
So, my question is how can I use the proper 'electron-renderer' target while having webpack pick up the correct, browser version of the child-module's dependencies?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment