When running npm run build
in production mode, I am encountering an issue where my Tailwind styles are not being purged. Despite filling the purge array in tailwind.config.js with template paths for webpack + postcss setup, I keep seeing the following warning:
warn - Tailwind is not purging unused styles because no template paths have been provided
warn - If you have manually configured PurgeCSS outside of Tailwind or are deliberately not removing unused styles, set `purge: false` in your Tailwind config file to silence this warning.
Here is a snippet of my tailwind.config.js:
module.exports = {
purge: ["public/index.html"],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
};
Additionally, here is my postcss.config.js configuration:
module.exports = {
plugins: {
tailwindcss: require("tailwindcss"),
autoprefixer: require("autoprefixer"),
},
};