From 5c3225c33c9fba80a3569b3f0b57f0646ebdcac6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 31 Jan 2018 01:12:34 +0000 Subject: [PATCH] Run Purgecss only for production Fixes #52 --- webpack.config.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index daf3d611..e6f9188e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -27,18 +27,20 @@ Encore.cleanupOutputBeforeBuild() }) .enableSourceMaps(!Encore.isProduction()); -Encore.addPlugin( - new PurgecssPlugin({ - paths: glob.sync([ - path.join(__dirname, "output_*/**/*.html"), - ]), - extractors: [ - { - extractor: TailwindExtractor, - extensions: ['twig', 'html', 'md'] - } - ] - }) -); +if (Encore.isProduction()) { + Encore.addPlugin( + new PurgecssPlugin({ + paths: glob.sync([ + path.join(__dirname, "output_*/**/*.html"), + ]), + extractors: [ + { + extractor: TailwindExtractor, + extensions: ['twig', 'html', 'md'] + } + ] + }) + ); +} module.exports = Encore.getWebpackConfig();