Home  >  Q&A  >  body text

javascript - After gulp uses testAutoFx to add a prefix, and then uses gulp-minify-css to compress the file, the file cannot be compressed normally.

The gulp-minify-css dependency has been added to the testAutoFx task, and the execution order is correct. The suffix can be added normally, but the css cannot be compressed

Add suffix task

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));
});`

Compression task

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

implement

  gulp.task('rel', ['compress-css'])
迷茫迷茫2647 days ago340

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 13:41:17

    This package has been discontinued, I use gulp-uglifycss

    reply
    0
  • Cancelreply