With Gulp

Last updated 2 months ago

Start by installing the Gulp plugin as a dev dependency.

npm i -D gulp-purgecss
const gulp = require('gulp')
const purgecss = require('gulp-purgecss')
‚Äč
gulp.task('purgecss', () => {
return gulp
.src('src/**/*.css')
.pipe(
purgecss({
content: ['src/**/*.html']
})
)
.pipe(gulp.dest('build/'))
})