Skip to content
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

Switch to new build procedure #44

Closed
dungwinux opened this issue Feb 25, 2019 · 4 comments · Fixed by #83
Closed

Switch to new build procedure #44

dungwinux opened this issue Feb 25, 2019 · 4 comments · Fixed by #83
Labels
enhancement New feature or request

Comments

@dungwinux
Copy link
Member

  • Uncompressed size: ~35MB
  • Compressed size (zip): ~12MB
  • Compressed size (7z): ~10MB

Definitely a problem with pkg when packaging. Any solutions are welcome.

@minhducsun2002
Copy link
Contributor

minhducsun2002 commented Mar 5, 2019

cipher@magister-mentium [0] ~/Projects/wafter $ npx pkg --targets node10-linux-x64,node10-win-x64 -o dist/wafter  .
> pkg@4.3.7
cipher@magister-mentium [0] ~/Projects/wafter $ ls --size dist/       
total 93448
53200 wafter-linux  40248 wafter-win.exe
cipher@magister-mentium [0] ~/Projects/wafter $ strip dist/*
cipher@magister-mentium [0] ~/Projects/wafter $ ls --size dist/
total 52776
29644 wafter-linux  23132 wafter-win.exe

Not really sure if the PE32+ executable can work normally as its ELF counterpart, so try this.

Make an ELF build for Linux systems, because things can be done cross-platform, also you would need Linux for strip to work.

EDIT (22:06 UTC+7) : Do not use this method! The JavaScript bundle at the end of the binary seems to be stripped off. See vercel/pkg#50 (comment). Haven't tested though.

@dungwinux
Copy link
Member Author

I've known this a long time ago. That's why I'm putting up this issue

@dungwinux dungwinux added the enhancement New feature or request label Mar 9, 2019
@dungwinux dungwinux changed the title Heavy attachment Switch to new build procedure Mar 25, 2019
@dungwinux dungwinux added the question Further information is requested label Mar 25, 2019
@dungwinux
Copy link
Member Author

dungwinux commented Apr 7, 2019

New proposed build procedure:

  1. Compile into one file using @zeit/ncc
  2. Build into exe using nexe. Bundling version here is convenient.
  3. Use UPX to compress executable

@dungwinux
Copy link
Member Author

dungwinux commented Apr 7, 2019

Test of new procedure @ master
Source file size (ncc): 2,894 KB
Binary size (nexe): 26,782 KB
Compressed size (upx): 11,309 KB
Update: It's noteworthy that the program still run properly after being compressed by upx

@dungwinux dungwinux removed the question Further information is requested label Apr 7, 2019
@dungwinux dungwinux pinned this issue Apr 15, 2019
dungwinux added a commit that referenced this issue May 10, 2019
@dungwinux dungwinux unpinned this issue Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants