又如何一键删除注释
|
chshouyuNov 14, 2014
1
|
|
ilihaiNov 14, 2014
2
mod_pagespeed也有这功能,就是不知道能不能达到你的要求。
|
|
66betaNov 14, 2014
3
你需要gulp跑task
// Scan Your HTML For Assets & Optimize Them gulp.task('html', function () { var assets = $.useref.assets({searchPath: '{.tmp,app}'}); return gulp.src('app/**/*.html') .pipe(assets) // Concatenate And Minify JavaScript .pipe($.if('*.js', $.uglify({preserveComments: 'some'}))) // Remove Any Unused CSS // Note: If not using the Style Guide, you can delete it from // the next line to only include styles your project uses. .pipe($.if('*.css', $.uncss({ html: [ 'app/index.html', 'app/styleguide.html' ], // CSS Selectors for UnCSS to ignore ignore: [ /.navdrawer-container.open/, /.app-bar.open/ ] }))) // Concatenate And Minify Styles // In case you are still using useref build blocks .pipe($.if('*.css', $.csso())) .pipe(assets.restore()) .pipe($.useref()) // Update Production Style Guide Paths .pipe($.replace('components/components.css', 'components/main.min.css')) // Minify Any HTML .pipe($.if('*.html', $.minifyHtml())) // Output Files .pipe(gulp.dest('dist')) .pipe($.size({title: 'html'})); }); |
|
66betaNov 14, 2014
4
当然Sublime Text的话,还有Minifier插件之类
反之,HTML-CSS-JS Prettify |
|
icanforkNov 14, 2014 via Android
5
你需要了一款前端的构建工具
|
|
FrankFang128Nov 14, 2014 via Android
6
不要跟风。
|
|
learnshareNov 14, 2014
7
Grunt 可以做,或者服务器开 Gzip 直接压缩传输的数据
|
|
kmvanNov 14, 2014
8
css和js可以考虑压缩,但html个人认为没这个必要。因为html不是每次都缓存的,压缩又耗cpu,而且有了gzip压缩,效果几乎一样。
|
|
0x142857Nov 14, 2014
10
|
|
loadingNov 14, 2014 via Android
11
你的html要有多大……
|
|
kfllNov 15, 2014 via Android
12
…楼主看到的那些没有空格的网站……实际上是生成的时候就没有空格的,而不是后来删掉的……
有没有空格表现不一样啊不能随便压缩 |