google / closure-compiler-npm

Package for managing and documenting closure-compiler for use via npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the best way to use google closure compiler?

classydraught opened this issue · comments

I have been using google-closure-compile@20201006.0.0 for quite a time. Since the start, I use it with a jar file (basically using JAVA).

example: java -jar node_modules/google-closure-compiler-java/compiler.jar --file.js

Recently I tried to compile it using npx

example : npx google-closure-compiler --file.js

And to my wonder, it was the fastest compilation to date. It just took me a few seconds to make a build whereas previously it used to take 2-3 minutes.

So my doubt is what is the best way to use google-closure-compiler as now because of the speed I feel like It's not that compiling with npx is not that powerful as java.

The npx version defaults to using the Graal native version instead of the Java version. I'd expect that version to be faster & would recommend it, but I'm surprised your build went from minutes to seconds.

Also, general questions should go to the closure-compiler-discuss mailing list. This repository tracks bugs specific to the NPM repository.

Closing this issue. Please post on closure-compiler-discuss if you want to follow up.