From 1a8decbda2ee19f7b4d547ccd508c9711a63105c Mon Sep 17 00:00:00 2001 From: Paul van Dyk <39598117+PaulPCIO@users.noreply.github.com> Date: Thu, 26 Mar 2020 11:59:02 +0100 Subject: [PATCH 1/4] Update postcss.config.js Return empty array if the condition is not met to avoid a null/undefined PostCSS plugin. --- examples/with-tailwindcss/postcss.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/with-tailwindcss/postcss.config.js b/examples/with-tailwindcss/postcss.config.js index 0daed9b0738d9..3c21d5e4698c3 100644 --- a/examples/with-tailwindcss/postcss.config.js +++ b/examples/with-tailwindcss/postcss.config.js @@ -1,7 +1,7 @@ module.exports = { plugins: [ 'tailwindcss', - process.env.NODE_ENV === 'production' + ...(process.env.NODE_ENV === 'production' ? [ '@fullhuman/postcss-purgecss', { @@ -12,7 +12,7 @@ module.exports = { defaultExtractor: content => content.match(/[\w-/:]+(? Date: Fri, 27 Mar 2020 16:49:51 +0100 Subject: [PATCH 2/4] Update postcss.config.js Fix array spread --- examples/with-tailwindcss/postcss.config.js | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/with-tailwindcss/postcss.config.js b/examples/with-tailwindcss/postcss.config.js index 3c21d5e4698c3..14a7971223a43 100644 --- a/examples/with-tailwindcss/postcss.config.js +++ b/examples/with-tailwindcss/postcss.config.js @@ -1,18 +1,19 @@ 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-/:]+(? Date: Fri, 27 Mar 2020 16:50:21 +0100 Subject: [PATCH 3/4] Update postcss.config.js remove extra operator --- examples/with-tailwindcss/postcss.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-tailwindcss/postcss.config.js b/examples/with-tailwindcss/postcss.config.js index 14a7971223a43..f5b82d0d263c3 100644 --- a/examples/with-tailwindcss/postcss.config.js +++ b/examples/with-tailwindcss/postcss.config.js @@ -1,7 +1,7 @@ module.exports = { plugins: [ 'tailwindcss', - ...(process.env.NODE_ENV === 'production' ? + ...(process.env.NODE_ENV === 'production' ? [ [ '@fullhuman/postcss-purgecss', From ced881d7663107494006905b43c9932fbc4c60ec Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 6 Apr 2020 12:03:55 +0200 Subject: [PATCH 4/4] Fix linting --- examples/with-tailwindcss/postcss.config.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/with-tailwindcss/postcss.config.js b/examples/with-tailwindcss/postcss.config.js index f5b82d0d263c3..23ffee56ffe55 100644 --- a/examples/with-tailwindcss/postcss.config.js +++ b/examples/with-tailwindcss/postcss.config.js @@ -1,7 +1,7 @@ module.exports = { plugins: [ 'tailwindcss', - ...(process.env.NODE_ENV === 'production' + ...(process.env.NODE_ENV === 'production' ? [ [ '@fullhuman/postcss-purgecss', @@ -10,10 +10,12 @@ module.exports = { './pages/**/*.{js,jsx,ts,tsx}', './components/**/*.{js,jsx,ts,tsx}', ], - defaultExtractor: content => content.match(/[\w-/:]+(? + content.match(/[\w-/:]+(?