Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noob question: After excluding modules from webpack, how do I get them into my Electron app's node_modules folder? #98

Closed
mountaindude opened this issue Mar 10, 2021 · 3 comments

Comments

@mountaindude
Copy link

I am very new to Webpack, have probably missed something obvious.
Building an Electron app using vue/cli.

After telling webpack not to include modules in my project's node_modules folder, those modules must instead, somehow, be copied to the Electron build directory's node_modules folder, before the actual Electron app is created.
Otherwise the app won't (of course...) run due to missing dependencies.

But what's the best way of doing this?
Running npm install or yarn in the build directory, using the package.json there?
Copying files from the project's node_modules directory? Seems very primitive...

@liady
Copy link
Owner

liady commented Apr 21, 2021

@mountaindude I think that if you're not building for a Node environment (like browser, electron, etc) - it's probably be best to do bundle all your dependencies. So maybe when building for Electron you don't need webpack-node-externals :)

@liady
Copy link
Owner

liady commented Apr 23, 2021

@mountaindude closing for now since excluding modules from the bundle is probably not a good strategy for electron apps - I believe that you probably should include them in the bundle.

@liady liady closed this as completed Apr 23, 2021
@serdarde
Copy link

Actually, it works very well for Electron's main and preload processes on dev mode. For production, you have to create a very long allow list, or you can use the solution kmjennison mentioned under the issue #72.

It makes no sense to use it on for renderer process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants