u-css-purge
v1.0.2
Published
An easy to use Node.js module that purges unused CSS code from your CSS files
Downloads
12
Readme
u-purge-css
An easy to use Node.js module that purges unused CSS code from your CSS files.
Installation
npm install u-purge-css
Usage
const purgeCss = require('u-purge-css');
purgeCss({
content: ['./src/**/*.html', './src/**/*.js'],
css: ['./src/**/*.css'],
output: 'purged.css',
whitelist: ['.keep-this-class']
});
Options
- content: An array of glob patterns for your HTML and JS files
- css: An array of glob patterns for your CSS files
- output: The output file path for the purged CSS
- whitelist: An array of selectors to keep regardless of usage