From f275ab778b8e7f0fef6bf4ec7f3c2d32baa3b64f Mon Sep 17 00:00:00 2001 From: Mark Ayers Date: Sat, 27 Mar 2021 08:08:07 -0400 Subject: [PATCH] Update postprocess.md - only in prod --- content/en/hugo-pipes/postprocess.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/en/hugo-pipes/postprocess.md b/content/en/hugo-pipes/postprocess.md index 742f47cd3..471977b7a 100755 --- a/content/en/hugo-pipes/postprocess.md +++ b/content/en/hugo-pipes/postprocess.md @@ -52,6 +52,12 @@ const purgecss = require('@fullhuman/postcss-purgecss')({ return els.tags.concat(els.classes, els.ids); } }); + +module.exports = { + plugins: [ + ...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : []) + ] + }; ``` Note that in the example above, the "CSS purge step" will only be applied to the production build. This means that you need to do something like this in your head template to build and include your CSS: