summaryrefslogtreecommitdiffstats
path: root/docs/content/en/hugo-pipes/postprocess.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/hugo-pipes/postprocess.md')
-rwxr-xr-xdocs/content/en/hugo-pipes/postprocess.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/content/en/hugo-pipes/postprocess.md b/docs/content/en/hugo-pipes/postprocess.md
index 6fb593950..aafb786a4 100755
--- a/docs/content/en/hugo-pipes/postprocess.md
+++ b/docs/content/en/hugo-pipes/postprocess.md
@@ -35,10 +35,12 @@ There are several ways to set up CSS purging with PostCSS in Hugo. If you have a
The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
-```toml
+{{< code-toggle file="config" >}}
[build]
writeStats = true
-```
+{{< /code-toggle >}}
+
+`postcss.config.js`
```js
const purgecss = require('@fullhuman/postcss-purgecss')({
@@ -50,12 +52,10 @@ const purgecss = require('@fullhuman/postcss-purgecss')({
});
module.exports = {
- plugins: [
- require('tailwindcss'),
- require('autoprefixer'),
- ...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
- ]
-};
+ 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: