Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
814 views
in Technique[技术] by (71.8m points)

gulp 使用 testAutoFx 添加前缀后,再使用gulp-minify-css压缩文件,无法正常压缩

已经给testAutoFx 任务添加gulp-minify-css依赖,执行顺序也对,可以正常添加后缀,但是无法压缩css

添加后缀任务

gulp.task('testAutoFx', function() {
    gulp.src(css)
        .pipe(autoprefixer({
            browsers: ['last 2 versions', 'Android >= 4.0', 'ios_saf>=6.0'],
            cascade: true, //是否美化属性值 默认:true     
            remove: true //是否去掉不必要的前缀 默认:true 
        }))
        .pipe(gulp.dest(dist_css));
});`

压缩任务

    gulp.task('compress-css',['testAutoFx'], function() {
    return gulp.src(dist_css_create)
        .pipe(minifyCSS())
        .pipe(gulp.dest(dist_css));
});

执行

  gulp.task('rel', ['compress-css'])

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

这个包已停用了,我用的是gulp-uglifycss


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...