TailwindCSS - Purge Keyframes not supported
When we use the following tailwind.config.js, no keyframes are removed...
module.exports = {
purge: {
enabled: true,
keyframes: true,
content: ["./**/*.cshtml", "./**/*.html", "./**/*.razor"]
}
};
If we use the same configuration within postcss.config.js for purgecss, the keyframes are removed, but so are all the html tags.
{
// Unnecessary information removed
"devDependencies": {
"autoprefixer": "^10.1.0",
"gulp": "^4.0.2",
"gulp-cli": "^2.3.0",
"gulp-clone": "^2.0.1",
"gulp-cssnano": "^2.1.3",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.0",
"gulp-rename": "^2.0.0",
"gulp-sourcemaps": "^3.0.0",
"merge-stream": "^2.0.0",
"postcss-focus": "^5.0.1",
"postcss-import": "^14.0.0",
"postcss-mixins": "^7.0.2",
"postcss-sort-media-queries": "^2.3.17",
"precss": "^4.0.0",
"purgecss": "^3.1.3",
"tailwindcss": "^2.0.2"
},
"peerDependencies": {
"postcss": "^8.2.2"
}
}
Hey! Your configuration is close but a tiny bit incorrect, needs to look like this:
module.exports = {
purge: {
enabled: true,
content: ["./**/*.cshtml", "./**/*.html", "./**/*.razor"],
options: {
keyframes: true,
}
}
};
Top-level options under "purge" are Tailwind's purge API, and any raw options you want to pass directly to PurgeCSS have to go under options 👍 Hope that helps!
Oh man, found the documentation about this.
Can you possibly expand the example here to make it a little more obvious? A bit annoying because we have about 20 keyframes grinding along all the time.
Added a few more examples to hopefully make it more obvious, will be live after the deploy it done:

Hey! Your configuration is close but a tiny bit incorrect, needs to look like this:
module.exports = { purge: { enabled: true, content: ["./**/*.cshtml", "./**/*.html", "./**/*.razor"], options: { keyframes: true, } } };Top-level options under "purge" are Tailwind's purge API, and any raw options you want to pass directly to PurgeCSS have to go under
options👍 Hope that helps!
Options for purge removed in version 3 and Keyframes not purged. What is the solution in this version?