Skip to content

Commit

Permalink
update postcss.config.js to fix warnings
Browse files Browse the repository at this point in the history
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.
25 changes: 14 additions & 11 deletions examples/blog-starter/postcss.config.js
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',
],
}
}

0 comments on commit 97649d4

Please sign in to comment.