Google Closure minifier online?

怎甘沉沦 提交于 2019-11-29 20:20:28

How about google's own service: http://closure-compiler.appspot.com/home

I should point out that "setting up the entire project on my own" really is not half as scary as you make it out to be :p.

I mean, it's a matter of downloading a java.jar and running it. Instructions:

  1. Download at http://closure-compiler.googlecode.com/files/compiler-latest.zip
  2. Unzip
  3. run java command line:

    java -jar compiler.jar --js script-src.js --js_output_file script-compiled.js

where <compiler.jar> is the full location to the compiler.jar file in the downloaded archive, script-src.js is the full filename of the source file, and script-compiled.js is the full filename of the result.

Google offers the Closure Compiler via REST API, which you can invoke from a shell

https://developers.google.com/closure/compiler/docs/gettingstarted_api

curl -v \
    -d code_url=http://server/js/file-big.js \
    -d compilation_level=ADVANCED_OPTIMIZATIONS \
    -d output_info=compiled_code \
    -d output_format=text \
    http://closure-compiler.appspot.com/compile \
    > radix.min.js
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!