peaceiris / actions-hugo

GitHub Actions for Hugo ⚡️ Setup Hugo quickly and build your site fast. Hugo extended, Hugo Modules, Linux (Ubuntu), macOS, and Windows are supported.
https://github.com/marketplace/actions/hugo-setup
MIT License
1.38k stars 80 forks source link

support: postcss not work correctly #594

Open elct9620 opened 2 years ago

elct9620 commented 2 years ago

Checklist

Describe your question

It does not work correctly when using PostCSS with PrugeCSS to clean CSS.

Use the same config to run hugo --minify in local machine (macOS) is work correctly.

Relevant links

Public repository: https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/tree/main
YAML config: https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/blob/main/config.toml
YAML workflow: https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/blob/main/.github/workflows/publish.yml

Relevant log output

Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add[5](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:6)c9f[6](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:7)6+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
INFO 2022/07/04 17:18:55 syncing static files to /
DEBUG 2022/0[7](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:8)/04 17:1[8](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:9):55 Render page 光之角落 SunnyCorner B&B to "/index.html"
INFO 2022/07/04 17:18:55 postcss: use config file /home/runner/work/sunnycorner-bb.github.io/sunnycorner-bb.github.io/postcss.config.js
INFO 2022/07/04 17:18:56 postcss: npm
INFO 2022/07/04 17:18:56 postcss:  notice
INFO 2022/07/04 17:18:56 postcss:  
INFO 2022/07/04 17:18:56 postcss: npm notice New minor version of npm available! 8.12.1 -> 8.13.2
INFO 2022/07/04 17:18:56 postcss: npm
INFO 2022/07/04 17:18:56 postcss:  
INFO 2022/07/04 17:18:56 postcss: notice
INFO 2022/07/04 17:18:56 postcss:  Changelog: <https://github.com/npm/cli/releases/tag/v8.13.2>
INFO 2022/07/04 17:18:56 postcss: npm notice Run `npm install -g npm@8.13.2` to update!
npm notice 
DEBUG 2022/07/04 17:1[9](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:10):02 Render XML for "sitemap" to "/sitemap.xml"
DEBUG 2022/07/04 [17](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:18):[19](https://github.com/sunnycorner-bb/sunnycorner-bb.github.io/runs/7184724032?check_suite_focus=true#step:8:20):02 Render page 光之角落 SunnyCorner B&B to "/index.xml"

Additional context.

The postcss.config.js is correctly loaded. But the purgecss plugin seems not to use the correct config.

If set defaultExtractor to return the [] will get same result in local machine.