evshiron / nwjs-builder

https://www.npmjs.com/package/nwjs-builder
76 stars 12 forks source link

Linux builds are incredibly large #46

Closed rstacruz closed 7 years ago

rstacruz commented 7 years ago

My Linux build is something like 600mb+, ouch. Any way to optimize this?

evshiron commented 7 years ago

@rstacruz ahuh, what options are you using? Did you try --production or --side-by-side option? Do you know who is occupying most of the space?

rstacruz commented 7 years ago

ahh, i'll have to try those! what's side-by-side?

evshiron commented 7 years ago

--side-by-side means not to combine the application package to the executable (that copy /b nw+app.nw app step). From #47, I assume you are running nwjs-builder directly in your project root, which will no doubt include every file in that directory. You might want to read Development section which I have explained why there isn't an excluding option. Most of the time you might be using some compilers/transpilers to transform the source code and have a lot of dependencies only used in development stage, along with tests and scripts. They are not going to be packaged when doing a release. So my suggestion is filling release files to a directory and using nwjs-builder to pack that directory. So there is no excluding needed :)

rstacruz commented 7 years ago

Ahhh, right. My app uses no transpilation (node.js 6 supports most of es6 anyway), so I was pretty concerned about that!

On Tue, Jul 26, 2016, 4:02 PM Evshiron Magicka notifications@github.com wrote:

--side-by-side means not to combine the application package to the executable (that copy /b nw+app.nw app step). From #47 https://github.com/evshiron/nwjs-builder/issues/47, I assume you are running nwjs-builder directly in your project root, which will no doubt include every file in that directory. You might want to read Development https://github.com/evshiron/nwjs-builder#development section which I have explained why there isn't an excluding option. Most of the time you might be using some compilers/transpilers to transform the source code and have a lot of dependencies only used in development stage, along with tests and scripts. They are not going to be packaged when doing a release. So my suggestion is filling release files to a directory and using nwjs-builder to pack that directory. So there is no excluding needed :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evshiron/nwjs-builder/issues/46#issuecomment-235191394, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEikd6vytCrXzOmnS9mI88nbD3zdg4Gks5qZb8qgaJpZM4JU159 .

rstacruz commented 7 years ago

Any hints on how to do that? Will I need 2 package.json's?

On Tue, Jul 26, 2016, 4:12 PM Rico Notifications < notifications@ricostacruz.com> wrote:

Ahhh, right. My app uses no transpilation (node.js 6 supports most of es6 anyway), so I was pretty concerned about that!

On Tue, Jul 26, 2016, 4:02 PM Evshiron Magicka notifications@github.com wrote:

--side-by-side means not to combine the application package to the executable (that copy /b nw+app.nw app step). From #47 https://github.com/evshiron/nwjs-builder/issues/47, I assume you are running nwjs-builder directly in your project root, which will no doubt include every file in that directory. You might want to read Development https://github.com/evshiron/nwjs-builder#development section which I have explained why there isn't an excluding option. Most of the time you might be using some compilers/transpilers to transform the source code and have a lot of dependencies only used in development stage, along with tests and scripts. They are not going to be packaged when doing a release. So my suggestion is filling release files to a directory and using nwjs-builder to pack that directory. So there is no excluding needed :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evshiron/nwjs-builder/issues/46#issuecomment-235191394, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEikd6vytCrXzOmnS9mI88nbD3zdg4Gks5qZb8qgaJpZM4JU159 .

evshiron commented 7 years ago

node.js 6.x is cool :) nwjs-builder used to require extra flags like --harmony-destructuring to work on node.js 4.x/5.x, and doesn't support legacy versions. But after publishing there were complaints for it and I started to use babel :)

evshiron commented 7 years ago

@rstacruz No. You can write a build.sh (or any other task runners) which copies every file you want to include (like package.json) to a separate directory and call nwjs-builder to make a bundle of it.