Pkg: uglify the js code and then pack it

Created on 27 Dec 2018  路  7Comments  路  Source: vercel/pkg

Hi,

I have tried to pack a single executable file and all works like a charm. but when I open it with notepad++, I can still see the pretty js codes. is it possible to uglify(compress) the js codes and then pack them? which would also reduce the binary file size

Thank you :)

All 7 comments

Please remove the "ISC" license from your package.json file. pkg does not bother to hide source code that is licensed as public

@mrleex I am using obfuscator for "uglify" and protect code before package using pkg.

Check this:

https://github.com/javascript-obfuscator/javascript-obfuscator

@JaLe29

How do you combine it with pkg?
What should I do to obfuscate the binaries generated by pkg?

@LubomirGeorgiev

1) Create code - normal.js file
2) Obfuscate this code - normal.js -> obfuscated.js
3) Bundle obfuscated.js using pkg.

Ok, I digged in deep using this obfuscator and it really not working for multiple file project.

There is a problem with the obfuscated required file.

PKG can't package obfuscated require like this.

Did you found some solution?

Removing license and setting private: true in package.json doesn't seem to affect anything with latest release. Am I missing something? Where does the rumour about license originate from?

Doesn't work for me either. Any update?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

telunc picture telunc  路  4Comments

peterjwest picture peterjwest  路  3Comments

ydubois-fr picture ydubois-fr  路  4Comments

hellower picture hellower  路  3Comments

j-brown picture j-brown  路  4Comments