Unverified Commit 19f41c60 authored by Paul van Dyk's avatar Paul van Dyk Committed by GitHub

Update postcss.config.js (#11366)

* Update postcss.config.js

Return empty array if the condition is not met to avoid a null/undefined PostCSS plugin.

* Update postcss.config.js

Fix array spread

* Update postcss.config.js

remove extra operator

* Fix linting
Co-authored-by: 's avatarTim Neutkens <timneutkens@me.com>
parent 20f2b0b3
module.exports = {
plugins: [
'tailwindcss',
process.env.NODE_ENV === 'production'
...(process.env.NODE_ENV === 'production'
? [
'@fullhuman/postcss-purgecss',
{
content: [
'./pages/**/*.{js,jsx,ts,tsx}',
'./components/**/*.{js,jsx,ts,tsx}',
],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
},
[
'@fullhuman/postcss-purgecss',
{
content: [
'./pages/**/*.{js,jsx,ts,tsx}',
'./components/**/*.{js,jsx,ts,tsx}',
],
defaultExtractor: content =>
content.match(/[\w-/:]+(?<!:)/g) || [],
},
],
]
: undefined,
: []),
'postcss-preset-env',
],
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment