Switch to purging css only in production

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
Thomas A. Christensen II 2022-03-26 21:01:43 -05:00
parent 6bbec3fac9
commit 212caea3c4
Signed by: millironx
GPG key ID: 139C07724802BC5D
2 changed files with 6 additions and 4 deletions

View file

@ -32,7 +32,7 @@ jobs:
npm install npm install
- name: Run Hugo - name: Run Hugo
run: | run: |
hugo hugo --environment production --minify
- name: Deploy to gh-pages - name: Deploy to gh-pages
if: ${{ !env.ACT }} if: ${{ !env.ACT }}
uses: rdarida/simple-github-pages-deploy-action@v1 uses: rdarida/simple-github-pages-deploy-action@v1

View file

@ -6,6 +6,8 @@ const purgecss = require("postcss-purgecss")({
}, },
}); });
module.exports = { if (process.env.HUGO_ENVIRONMENT === 'production') {
plugins: [purgecss], module.exports = {
}; plugins: [purgecss],
};
}