Answer the question
In order to leave comments, you need to log in
How to configure gulp-uncss for each page?
Using plugin https://www.npmjs.com/package/gulp-uncss
Code example:
gulp.task('uncss-go', function () {
return gulp.src('dist/css/main.css')
.pipe(uncss({
html: ['dist/index.html']
}))
.pipe(gulp.dest('dist/css'));
});
Answer the question
In order to leave comments, you need to log in
Hi, the plugin description says:
Options: html
Type: Array|String Required value.
An array which can contain an array of files relative to your gulpfile.js, and which can also contain URLs. Note that if you are to pass URLs here, then the task will take much longer to complete. If you want to pass some HTML directly into the task instead, you can specify it here as a string.
i.e. you can write like this:
html: ['index.html', 'posts/**/*.html', 'http://example.com']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question