How to use gulp-purgecss - 2 common examples

To help you get started, we’ve selected a few gulp-purgecss examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taylorbryant / jekyll-starter-tailwind / gulpfile.babel.js View on Github external
task("processStyles", done => {
  browserSync.notify("Compiling styles...");

  return src(rawStylesheet)
    .pipe(postcss([atimport(), tailwindcss(tailwindConfig)]))
    .pipe(gulpif(devBuild, sourcemaps.init()))
    .pipe(
      gulpif(
        !devBuild,
        new purgecss({
          content: ["_site/**/*.html"],
          extractors: [
            {
              extractor: TailwindExtractor,
              extensions: ["html", "js"]
            }
          ]
        })
      )
    )
    .pipe(gulpif(!devBuild, postcss([autoprefixer(), cssnano()])))
    .pipe(gulpif(devBuild, sourcemaps.write("")))
    .pipe(dest(cssRoot));
});
github nstungcom / gulp-starter-kit / gulpfile.babel.js View on Github external
function cleanUnusedCSS () {
  return gulp.src(`${PATHS.dist}/**/*.css`)
    .pipe(purgecss({
      content: [`${PATHS.dist}/**/*.{html,js}`]
    }))
    .pipe(gulp.dest(PATHS.dist))
}

gulp-purgecss

Gulp plugin for purgecss

MIT
Latest version published 8 months ago

Package Health Score

83 / 100
Full package analysis

Popular gulp-purgecss functions