From 212caea3c444940ad44c76cbb42f3559dedba3cb Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 26 Mar 2022 21:01:43 -0500 Subject: [PATCH] Switch to purging css only in production Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com> --- .github/workflows/build-site.yml | 2 +- postcss.config.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-site.yml b/.github/workflows/build-site.yml index bc23a5e..cc24aea 100644 --- a/.github/workflows/build-site.yml +++ b/.github/workflows/build-site.yml @@ -32,7 +32,7 @@ jobs: npm install - name: Run Hugo run: | - hugo + hugo --environment production --minify - name: Deploy to gh-pages if: ${{ !env.ACT }} uses: rdarida/simple-github-pages-deploy-action@v1 diff --git a/postcss.config.js b/postcss.config.js index d0a0b99..ecf2433 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -6,6 +6,8 @@ const purgecss = require("postcss-purgecss")({ }, }); -module.exports = { - plugins: [purgecss], -}; +if (process.env.HUGO_ENVIRONMENT === 'production') { + module.exports = { + plugins: [purgecss], + }; +}