-
Notifications
You must be signed in to change notification settings - Fork 123
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
The file size is abnormal after packaging #66
Comments
I'm also concerned about the size of my app. For example, electron-vue-template nsis installer for Windows is 191MB and the installed app takes up 700MB on disk. |
The package.json is indeed needed as Electron Builder uses it to fetch some information, like what file to use as an entrypoint. If the node_modules directory really doesn't need to be copied, we should remove it. I didn't know it took up so much space 😮 |
Not sure, files are usually packaged, but there are special cases where some libraries cannot be compiled, such as sharp, maybe there should be a list |
Just confirmed that node_modules doesn't have to be copied over to the build folder. Sweet! Makes the build also slightly faster. Thanks for showing @nanfb :-) |
Just checked how it works on my app, and unfortunately these changes cause not all required dependencies to be included in the built app. Removing the |
That's a bit unfortunate...
This would also include the What dependencies are causing it to break for you? |
Probably, but at least the app works and has reasonable size :) I assume this filter should be tweaked somehow.
My app reports about electron-store dependency (error when run the built app), but it might be just the first one. |
I just checked out the default value for |
I said above that some packages cannot be packaged into app.asar. When there is a problem, you need to explicitly filter it, such as sharp, an image processing package. You need to consider these problems. |
I see that you've already added these defaults. But I assume it's not needed. I've tested a bit and it seems all default ignores are added implicitly (as those doc says - "All default ignores are added in any case — you don’t need to repeat it if you configure own patterns") For now, I have come up with the following content for the `files' section, which seems to work fine for my project:
I changed standard ignores for |
If the code on the main branch is packaged directly, the dist size reaches 1g. This is not normal. Is there any way to optimize it?
The text was updated successfully, but these errors were encountered: