There is a CSS file in my theme’s static file directory, I want to run PostCSS on it (to purge it). I’m using resources.Get but that didn’t work (I get some nil reference error). I read in the docs that anything that needs to be processed by Hugo pipes should live in an assertDir.
I didn’t want to copy files from the theme folder, and since I don’t have any other assets, I configured my assertDir = "static", but that didn’t change anything about the error.
I updated my assetDir to themes/that-theme/static. this way it works.
I still have an issue with my PostCSS configuration. I installed postcss-cli as a global npm package, and I did the same for @fullhuman/postcss-purgecss. I get an error saying that the latter cannot be found.
I managed to fix the PostCSS error by installing this npm package locally in my project. I guess it wasn’t meant to be used with a globally installed purgecss.
I’m not sure what you mean by ‘snap’, I’m on Windows and I have Hugo as a standalone executable.
I installed both yes, first as global npm packages, then local to my project folder.
I hope you don’t mind me asking one more question about purgecss. My theme has some javascript file with some inline HTML with CSS classes. How do I get purgecss to analyze that inline HTML?
Right now it looks like a few CSS classes too many are being purged, so I guess it’s related to that js file.