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
Build contains node_modules with vue #223
Comments
Oh wow, huge 👍 for finding that @plutonly. I just verified and Will be great to see this fixed. |
Electron builder handles the build step, and that is what packages the node_modules into your app. It should only packages dependencies (not devDependecies). I am trying to find a way to only package native modules. For now, maybe this stack overflow question can help. |
Yeah, I think we would need to exclude copying all the modules except those marked in webpack's 'externals' option. So maybe electron-builder's config would be:
This could be added to package.json whenever plugin electron-builder is installed. |
The issue with that is that it won't exclude dependencies of that dep. Ie if |
Released version |
I don't think this was a correct fix. |
Did you mark the dependency as an external? |
Hi @Killea, Instead of commenting this line https://github.com/nklayman/vue-cli-plugin-electron-builder/blob/master/index.js#L153 You can add this code, into your
My whole config now looks like this
cc: @nklayman |
Yep, adding it as an external is the proper solution. You shouldn't need the configurewebpack option. |
You're right - it works. That make more sense now. Thanks! |
After being added to externals, I am still prompted that I "cannot find module 'ffi napi'" My configuration is as follows
If I run electron: serve directly, this problem will not occur. How can I solve it? |
Final build of application created with vue CLI and plugin electron-builder contains the following:
app.asar
etc.
Basically dependencies in package.json is copied which is electron-build's default behaviour.
Since Vue CLI already uses webpack to bundle these in static/js, isn't this just an unused duplication?
To Reproduce
Steps to reproduce the behavior:
Create basic app using Vue CLI. Add plugin electron-builder. Run electron:build. Examine dist_electron/win-unpackaged/resources/app.asar
Expected behavior
node_modules in app.asar should only contain modules not already bundled using webpack.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: