re: Building a Desktop App with Vue: NW.js VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Could you describe given process to optimize NW.js package step by step? Given article tells us about other case with 59.8Mb installer result. But...
 

I didn't do anything that isn't mentioned in the article. I just took it to the extreme in every scenario.

  1. The existing package.json had 4 items listed as dependencies that should have been devDependencies, so that alone shaves off like 20 MB.
  2. Built the Vue app using the Vue CLI's built in webpack commands (bundling/tree-shaking). So I'm only using the static files from the dist folder and not shipping all the source files with it. They're also minified/uglifed, but this makes very little difference.
  3. Because this app is so simple and doesn't even access Node or the OS at all. I used the older version of NW.js (0.12.3). I wouldn't normally use that version, but if filesize was my highest concern (like in this case), then I might.
  4. I removed any NW.js files that aren't needed for the app to run (this can be risky, but this is a very simple app, so I'm not worried). This takes the app down from around like 85 MB to 61.5 MB.
  5. I used WinRAR's SFX (self-extracting executable) options to create an installer. Since I'm using WinRAR to make the installer, I can take advantage of its superior compression ratio, which is what gets the 61.5 MB down to 20 MB.

In a more real world scenario the installer would be closer to 60 MB, and the installed version would be closer to 110MB. Ultimately, there is only so much you can do while shipping a copy of Node and an entire browser to your user. If filesize really is your greatest concern, then browser-based desktop apps aren't the way to go. I've compiled a list of alternative tools with pros/cons at XPDA.net

You could get it even smaller, probably well under 10mb with neutralino.js.org/

:)

Neutralino is a neat little tool. It would certainly work in this simple app example. It has a lot of drawbacks though and you'd be better off with something more fleshed out. Even if your primary concern is filesize, there are plenty of other tools that produce very small packages with a better feature set. You can check out the cons of Neutralino, and some other alternatives here: xpda.net/#NeutralinoJs

code of conduct - report abuse