sublime text2之js壓縮-Js Minifier


一款基於Google Closure compiler壓縮Js文件插件。

快捷鍵:

Ctrl+Alt+M            當前文件內壓縮Js代碼(不推薦)

Ctrl+Alt+Shift+M   壓縮Js並生成壓縮文件 *.min.js

 

安裝成功重啟,如果報錯,在配置里改一個參數,"compiler": "uglify_js",
{
    // the closure compiler adds new lines every 500 characters
    // for some proxies that choke with lines longer than that... don't care?
    // set this setting to true.
    "remove_new_lines": false,

    // the default optimization level to use for minification. Acceptable optios are:
    // WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS
    // These primiarly apply to the closure compiler. For more info on which to use, go to: https://developers.google.com/closure/compiler/docs/compilation_levels
    "optimization_level": "WHITESPACE_ONLY",

    // the compiler to use for minification.
    // Accepted values are: google_closure|uglify_js
    "compiler": "uglify_js",

    // when you create a file you want to automatically open it?
    "open_on_min": true
}

 

下載地址:https://github.com/cgutierrez/JsMinifier


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM