sublime3安装minify
压缩js代码
打开SublimeText,快捷键ctrl+shift+p调出package control输入install package找到minify回车安装即可,安装结成功后该文档在编辑器中弹出。
# 未安装过minify所需组件的命令(文档命令)
npm install -g clean-css-cli@4.3.0 uglifycss js-beautify html-minifier uglify-js minjson svgo
# 未安装过minify所需组件的命令(改装支持es6的命令)
# npm install -g clean-css-cli@4.3.0 uglifycss js-beautify html-minifier minjson svgo
# npm install -g --save-dev uglify-js@github:mishoo/UglifyJS2#harmony
#已经安装minify所需组件的可执行下更新命令
npm update -g clean-css-cli@4.3.0 uglifycss js-beautify html-minifier uglify-js minjson svgo
# 注意如果已经安装了es5的uglify-js可以通过重新配置package.json 或者 uninstall -g uglify-js再重新安装--save-dev uglify-js@github:mishoo/UglifyJS2#harmony
# 如果不懂移除请自行百度(或直接清空npm的根目录全部重新安装!!!最彻底,但代价大不推荐)
# 附上 uglify-js文档一份 https://www.npmjs.com/package/uglify-js-es6#harmony
1. Install Node.js
Windows和Mac OS X用户只需要访问https://nodejs.org/ 并且点击install按钮安装即可
2. 安装完成后检查是否安装成功
打开命令行(Mac OS 下的终端/windows下的cmd.exe)输入以下命令
node –version
3. 安装所需依赖包
npm install -g clean-css-cli uglifycss js-beautify html-minifier uglify-js minjson svgo
如果sublime text无法运行install package
https://packagecontrol.io/installation#st3
Manual
If the command palette/menu method is not possible due to a proxy on your network or using an old version of Sublime Text, the following steps will also install Package Control:
Click the Preferences > Browse Packages… menu
Browse up a folder and then into the Installed Packages/ folder
Download Package Control.sublime-package and copy it into the Installed Packages/ directory
Restart Sublime Text
安装html css json等格式化插件
Through Sublime Package Manager
Ctrl+Shift+P or in Linux/Windows/OS XCmd+Shift+P
type , select installPackage Control: Install Package
type , select prettifyHTML-CSS-JS Prettify
安装好后,进入
"all":
{
// These rules apply to any supported code that is going to be be prettified,
// and have the lowest level of precedence (meaning any of the settings in
// the 'html', 'css', 'js', 'json' and 'custom' categories override these).
// You can add other .jsbeautifyrc rules in this section too.
// End output with newline
"end_with_newline": false,
// Character(s) to use as line terminators.
"eol": "\n",
// Initial indentation level
"indent_level": 0,
// Indentation character
"indent_char": " ",
// Indentation size
"indent_size": 2, // 这里缩进调整为2!!!
pip debug –verbose
我编译后放在网盘
最后编辑:秦晓川 更新时间:2025-09-28 16:45