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

npm package is fatter than before #95

Closed
leeoniya opened this issue Jul 18, 2018 · 5 comments
Closed

npm package is fatter than before #95

leeoniya opened this issue Jul 18, 2018 · 5 comments

Comments

@leeoniya
Copy link

leeoniya commented Jul 18, 2018

hey @ChadKillingsworth,

i try to keep my node_modules weight as small as possible, and have noticed that google-closure-compiler is much heavier than the previous google-closure-compiler-js. i do see that it has facilities for detecting what version to run behind the scenes (native, java or js) and spends some time potentially downloading those. however, if i explicitly want the js version, then all i technically need is the compiler itself (jscomp.js) which is a mere 3.2MB single file. ideally, my build script would simply download & require this file (is it hosted anywhere?) without any additional npm dependency bloat.

below is a screenshot of node_modules stats with google-closure-compiler-js (left) and the current google-closure-compiler (right). if i just grabbed the single jscomp.js file myself, the result would be about 13MB smaller than even the former.

do you have any advice?

thanks!

closure-compiler

@leeoniya
Copy link
Author

leeoniya commented Jul 18, 2018

here's what it looks like if i copy jscomp.js plus the closure-compiler-js.js shim into a ./lib folder and remove all google-closure-compiler* npm dependencies:

closure-compiler-2

it would be extremely useful if an npm package was maintained that had nothing except these 2 files.

@ChadKillingsworth
Copy link
Collaborator

Unfortunately that is too much for us to maintain right now. It's also much harder for people to keep plugins in sync with compiler versions for this strategy.

We knew that combining repos would increase the size of the package, but this is after all a build tool and rarely used in production.

The benefits of being able to switch between platforms with an single option far outweigh the size constraints.

@leeoniya
Copy link
Author

understood. is there anywhere that a pre-built jscomp.js can be fetched from?

if not, i'll just maintain https://github.com/domvm/closure-compiler-js-prebuilt manually.

@ChadKillingsworth
Copy link
Collaborator

Let me talk to the team about adding the prebuilt jscomp.js and native binaries to github release.

@leeoniya
Copy link
Author

awesome, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants