前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >sublime text2之js压缩-Js Minifier

sublime text2之js压缩-Js Minifier

作者头像
deepcc
发布2018-05-16 14:55:19
4.9K0
发布2018-05-16 14:55:19
举报
文章被收录于专栏:deepccdeepcc

一款基于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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-06-06 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档