From 19f41c60bc27d4d9cdb18a03aa8733f0bd6bc213 Mon Sep 17 00:00:00 2001 From: Paul van Dyk <39598117+PaulPCIO@users.noreply.github.com> Date: Mon, 6 Apr 2020 12:06:06 +0200 Subject: [PATCH] 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: Tim Neutkens --- examples/with-tailwindcss/postcss.config.js | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/with-tailwindcss/postcss.config.js b/examples/with-tailwindcss/postcss.config.js index 0daed9b0738d9..23ffee56ffe55 100644 --- a/examples/with-tailwindcss/postcss.config.js +++ b/examples/with-tailwindcss/postcss.config.js @@ -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-/:]+(? + content.match(/[\w-/:]+(?