Posted by Sam Thorogood, Developer Programs Engineer
How does this work?
To find out more about Closure Compiler's internals, be sure to check out this post by Dimitris (who works on the Closure team at Google), other posts on the Closure Tools blog, or read an exploratory post about Closure and how it can help your project in 2016.
Note that the JS version is experimental. It may not perform in the same way as the native Java version, but we believe it's an interesting new addition to the compiler landscape, and the Closure team will be working to improve and support it over time.
How can I use it?
To include the JS version of Closure Compiler in your project, you should add it as a dependency of your project via NPM-
To then use the compiler with Gulp, you can add a task like this-
const compiler = require('google-closure-compiler-js').gulp();
For more information, check out Usage, supported Flags, or a demo project. Not all flags supported in the Java release are currently available in this experimental version. However, the compiler will let you know via exception if you've hit any missing ones.