Last updated
Last updated
is a tool to remove unused CSS. It can be used as part of your development workflow. PurgeCSS comes with a JavaScript API, a CLI, and plugins for popular build tools.
Here are a couple of ways to use PurgeCSS:
You can install the CLI in two ways. By installing PurgeCSS globally or using npx.
Run PurgeCSS from the terminal:
Install PurgeCSS as a dev dependency:
Run PurgeCSS from the terminal:
Install PurgeCSS as a dev dependency:
Install the Webpack plugin as a dev dependency:
Use the plugin in your Webpack config:
Install the PostCSS plugin as a dev dependency:
Use the plugin in your PostCSS config:
Install the Gulp plugin as a dev dependency:
Use the plugin in your Gulpfile:
Install the Grunt plugin as a dev dependency:
Use the plugin in your Gruntfile:
Install the Rollup plugin as a dev dependency:
Use the plugin in your Rollup config:
allows you to run the CLI locally without installing the package globally.