使用gulp-uncss清理多余无用css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:15:11
Original
1444 people have browsed it

 

cnpm 也可以使用npm

cnpm install gulp-uncss --save-dev
Copy after login

gulpfile.js

var gulp = require('gulp'),    uncss = require('gulp-uncss');gulp.task('uncss', function() {    gulp.src('src/css/origin.css')   //冗余css文件        .pipe(uncss({            html: ['src/origin.html']  //使用css的html页面,可多个        }))        .pipe(gulp.dest('build/css/uncss')); //输出目录});
Copy after login

 

挺简单得就去除多余无用的css,再也不用css usage自己手动搞。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template