html
、css
、js
专用压缩用minify
,让代码都变成一行,去除所有的空格,变得更精简用代码合并
html
、css
、js
压缩min
安装模块
command + shift + x
输入minify
并安装第一个
快捷键
command+shift+p
,调出命令窗口,输入minify
,*.css
会在当前目录下会生成*.min.css
效果
源代码
1 | * { |
压缩后代码
1 | *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} |
合并代码
1.选中代码
2.command+shift+p
,调出命令窗口,输入join lines
,确认执行就可以合并所选中代码
3.里面有行注释的,合并后无法运行代码
合并前
1 | // 禁止右键菜单 |
合并后
1 | // 禁止右键菜单 document.oncontextmenu = function () { return false; }; // 禁止文字选择 document.onselectstart = function () { return false; }; // 禁止复制 document.oncopy = function () { return false; }; // 禁止剪切 document.oncut = function () { return false; }; // 禁止粘贴 document.onpaste = function () { return false; }; |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Ln's Blog!
评论