V
V
Vitalii2016-02-26 22:40:40
gulp.js
Vitalii, 2016-02-26 22:40:40

How to set stylesheet to be ignored for uncss in gulp?

gulp.task('build', ['clean'], function () {
    return gulp.src('app/*.html')
        .pipe(useref())
        .pipe(gulpif('*.js', uglify()))
        .pipe(gulpif('*.css', autoprefixer({
      browsers: ['last 30 versions'],
      cascade: false
    })))
        .pipe(gulpif('*.css', uncss({
            html: ['./app/index.html'],
            ignoreSheets: ['app/css/test.css']   // не работает!!! 
        })))
        .pipe(gulpif('*.css', minifyCss()))
        .pipe(gulp.dest('dist'));
});

the table contains styles of dynamically created page elements, which are removed when passing through uncss. How to disable stylesheet tracking in gulp-uncss? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-02-27
@sim3x

Note that options.ignoreSheets is already defined for you. gulp-uncss will only process CSS files in the stream.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question