Open In App

What is use PurgeCSS in a Tailwind CSS Project ?

PurgeCSS in a Tailwind CSS project is a tool used to eliminate unused CSS styles from your final production build. It analyzes your codebase and removes any styles that are not applied in your HTML or JavaScript, resulting in a smaller and more optimized stylesheet for better performance.

Steps to Configure the PurgeCSS

Step 1: Install the PostCSS plugin:

npm i -D @fullhuman/postcss-purgecss

Step 2: Add the PurgeCSS plugin to the PostCSS configuration:

const purgecss = require('@fullhuman/postcss-purgecss')
module.exports = {
plugins: [
purgecss({
content: ['./**/*.html']
})
]
}

Key Features:

Article Tags :