I just recently built an electron app and packaged it using electron-packager. The .exe file is 55,000kb and the rest of the folder is quite bulky as well. Is there any way to take down the size of this application at all?
Electron applications consume a lot of disk space because each application is bundled with Chromium and Node. On the other hand, Tauri and Neutralino. js have surprisingly lightweight bundle sizes because those frameworks are reusing the user's operating system's system web browser library.
Because Electron is essentially a “browser in a box,” every Electron app also comes with the Electron framework, which weighs in at an astonishing 120 MB. Because of how Electron works, you can't install the framework on your computer and then get all the other apps that use Electron to use it.
Electron will use a ton of memory because it's running a full browser inside a browser/desktop, Chromium, along with running v8 and all of it's own code. Along with that Chromium is already known for high memory usage. So it's relatively normal to see high memory.
Here's a github issue on it.
The comment I'm emphasizing is:
That's the expected size, there is no way to make it smaller.
The reason why it's so big is because electron is loading most of chromium inside that 50mb file.
So no unfortunately there is no way to make it smaller sorry.
A somewhat helpful post from that github thread suggests removing unnecessary node modules via electron-packager. It also offers a bit more explanation on why files are so large.
You can zip your app and if you're using electron-packager you can ignore some node modules that you don't need when the app is running, this makes it a bit smaller. For instance I have a 37MB zipped Electron app (Note Windows version is much larger as it contains a copy of Git). But Electron will always have a large part of Chrome in it so there is only so much that can be done. Electron itself right now is ~33MB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With