6.0.0 • Published 28 days ago

gulp-purgecss v6.0.0

Weekly downloads
5,091
License
MIT
Repository
github
Last release
28 days ago

gulp-purgecss

npm license

gulp plugin to removed unused CSS, using purgecss

Regarding Issues

This is just a simple gulp plugin, which means it's nothing more than a thin wrapper around purgecss. If it looks like you are having CSS related issues, please go to the purgecss repo. Only create a new issue if it looks like you're having a problem with the plugin itself.

Install

npm i -D gulp-purgecss
npm install --save-dev gulp-purgecss

Usage

By default, purgecss outputs the source CSS with unused selectors removed:

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/css'))
})

By setting the rejected option, you can 'invert' the output to list only the removed selectors:

const gulp = require('gulp')
const rename = require('gulp-rename')
const purgecss = require('gulp-purgecss')

gulp.task('purgecss-rejected', () => {
    return gulp.src('src/**/*.css')
        .pipe(rename({
            suffix: '.rejected'
        }))
        .pipe(purgecss({
            content: ['src/**/*.html'],
            rejected: true
        }))
        .pipe(gulp.dest('build/css'))
})

Versioning

We use SemVer for versioning.

License

This project is licensed under the MIT License - see the LICENSE file for details

6.0.0

28 days ago

6.0.0-alpha.0

1 year ago

5.0.0

2 years ago

4.1.3

2 years ago

4.1.2

2 years ago

4.1.0

2 years ago

4.1.1

2 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.1.3

3 years ago

3.1.3-alpha.0

3 years ago

3.1.0

3 years ago

3.1.0-alpha.0

3 years ago

3.0.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.0

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

1.2.0

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.21.0

6 years ago

0.20.0

6 years ago

0.19.0

6 years ago

0.18.0

6 years ago

0.16.0

6 years ago

0.15.0

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.8.0

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago