Complexity Score
High
Open Issues
N/A
Dependent Projects
39
Weekly Downloadsglobal
9,188
Keywords
License
- MIT
- Yesattribution
- Permissivelinking
- Permissivedistribution
- Permissivemodification
- Nopatent grant
- Yesprivate use
- Permissivesublicensing
- Notrademark grant
Downloads
Loading Weekly Download Data
Readme
PurgeCSS
What is PurgeCSS?
When you are building a website, chances are that you are using a css framework like Bootstrap, Materializecss, Foundation, etc… But you will only use a small set of the framework and a lot of unused css styles will be included.
This is where PurgeCSS comes into play. PurgeCSS analyzes your content and your css files. Then it matches the selectors used in your css files with the ones in your content files. It removes unused selectors from your css, resulting in smaller css files.
Sponsors 🥰
Documentation
You can find the PurgeCSS documentation on this website.
Table of Contents
PurgeCSS
- Configuration
- Command Line Interface
- Programmatic API
- Safelisting
- Extractors
- Comparison
Plugins
- PostCSS
- Webpack
- Gulp
- Grunt
- Gatsby
Guides
- Vue.js
- Nuxt.js
- React.js
- Next.js
- Razzle
- Hugo
Getting Started
Installation
npm install purgecss --save-dev
Usage
import { PurgeCSS } from "purgecss";
const purgeCSSResults = await new PurgeCSS().purge({
content: ["**/*.html"],
css: ["**/*.css"],
});
Packages
This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:
Package Version Description purgecss The core of PurgeCSS postcss-purgecss PostCSS plugin for PurgeCSS purgecss-webpack-plugin Webpack plugin for PurgeCSS gulp-purgecss Gulp plugin for PurgeCSS grunt-purgecss Grunt plugin for PurgeCSS rollup-plugin-purgecss Rollup plugin for PurgeCSS purgecss-from-html Html extractor for PurgeCSS purgecss-from-pug Pug extractor for PurgeCSS purgecss-with-wordpress Collection of safelist items for WordPress vue-cli-plugin-purgecss Vue CLI Plugin for PurgeCSSDependencies
Loading dependencies...
CVE IssuesActive
0
Scorecards Score
5.30
Test Coverage
No Data
Follows Semver
Yes
Github Stars
7,891
Dependenciestotal
11
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No Data
Repo Audits
No Data
Learn how to distribute gulp-purgecss in your own private NPM registry
$npm config set registry
https://npm.cloudsmith.com/owner/repo
/Processing...
✓Done
$npm install gulp-purgecss
/Processing...
✓Done
46 Releases
NPM on Cloudsmith