forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update postcss.config.js to fix warnings
Return empty array if the condition is not met to avoid a null/undefined PostCSS plugin. Related PR: vercel#11366
- Loading branch information
David Pike
committed
Apr 21, 2020
1 parent
16e7871
commit 97649d4
Showing
1 changed file
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
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', | ||
], | ||
} | ||
} |