Next.js Discord

Discord Forum

An unknown PostCSS plugin was provided (postcss.config.js)

Answered
Japanese Bobtail posted this in #help-forum
Open in Discord
Avatar
Japanese BobtailOP
module.exports = { plugins: [ 'tailwindcss', 'autoprefixer', process.env.NODE_ENV === 'production' && 'cssnano', ], };

How can i fix this? I want to add a plugin conditionally.
Answered by Japanese Bobtail
I've solved this
module.exports = { plugins: process.env.NODE_ENV === 'production' ? ['tailwindcss', 'autoprefixer', 'cssnano'] : ['tailwindcss', 'autoprefixer'], };
View full answer

1 Reply

Avatar
Japanese BobtailOP
I've solved this
module.exports = { plugins: process.env.NODE_ENV === 'production' ? ['tailwindcss', 'autoprefixer', 'cssnano'] : ['tailwindcss', 'autoprefixer'], };
Answer