electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.66k stars 1.74k forks source link

Webpack externals #4804

Closed caraie closed 4 years ago

caraie commented 4 years ago

In my project I'm using webpack for generating a bundle. I had to declare one of my dependencies as external, since it doesn't work properly with webpack. That means that dependency will be consumed from the node_modules. The problem is that electron-builder removes all the node_modules when executed, so my dependency is not part of the final bundle. I tried declaring that dependency in the files section of the electron builder configuration with no luck. Is there any way to avoid this issue?

vladimiry commented 4 years ago

If the dependency listed in devDependencies section try moving it to dependencies.

caraie commented 4 years ago

it's already there in dependencies. I resolved the issue by switching from node-pre-gyp to prebuildify. node-pre-gyp doesn't work fine with webpack, so I had to declare it as external for that reason.

vladimiry commented 4 years ago

@caraie I think you should close the issue since it got resolved.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.