Open deadcoder0904 opened 4 years ago
Found the solution 🎉
Don't need to add @fullhuman/postcss-purgecss
npm install tailwindcss autoprefixer --save-dev
It becomes
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
tailwind.config.js
& add purge
propertymodule.exports = {
purge: {
content: ['./components/**/*.js', './pages/**/*.js'],
options: {
whitelist: ['text-pink-500', 'text-yellow-500'], // anything that needs to be whitelisted
},
},
theme: {
extend: {},
},
variants: {},
plugins: [],
}
Reference: https://github.com/tailwindcss/tailwindcss/pull/1639
Thanks @deadcoder0904, worked like a charm! At the time of writing I had no need for whitelisting so the following minimal config was enough:
tailwind.config.js
module.exports = {
purge: {
content: ['./components/**/*.js', './pages/**/*.js'],
}
};
Thank you for https://statickit.com/guides/next-js-tailwind
I followed it many times. Tried updating but Purge CSS deletes my CSS. Mind updating the guide?