The template I’m using (hugo-theme-bootstrap) uses postcss and purgecss – does it seem like that’s the culprit?
It’s not too important – I can just run a full build on a development machine to check that production is looking good. I was just curious if anyone knew of a fix.
v0.104.2 extended. Maybe I should word the question this way:
How do you use hugo server to mimic a production build?
If I’ve guessed correctly and hugo server -e production -b "http://localhost:1313/" is correct but it’s just not working in my environment, then I have no interest in hunting down the problem. I’ll blame the theme and move on – I’m happy to do a full build for a pre-push test.
Ah, I thought I needed the baseUrl flag because in production/config.yaml I’ve got a target URL defined, but that doesn’t seem to be the case – hugo server is smart enough to use the localhost.
But --disableFastRender did the trick. Thanks for the help!
Just wanted to add that in playing around a little, I discovered that part of the issue was that Chrome-Windows and Chrome-Mac (but not Chrome-iOS) was blocking the CSS from loading due to the integrity value in the css’s link attribute.
Unfortunately, a mismatched integrity value was also going out to my production code, and so Chrome refused to load the CSS. Something about the theme (using hugo’s | fingerprint pipe) is producing the wrong value, at least sometimes, even during full builds, but definitely during fast render.
Anywho, I’m not pushing to a CDN so I’m not too worried about integrity of the CSS – I just tossed it and everything is working fine now. I just thought this might be a good thing to leave here as useful information for theme developers. I’m posting a similar message for this theme’s developer.