I am a theme creator and I created a theme usingPostCSS and tailwind. And according to my understanding, users of my theme may need to use npm to install all the components that tailwind needs.
But this will bring inconvenience to users. Especially for users who don’t have npm.
And for most users, they don’t need to modify the css file. If I can directly generate the css file and provide it to the user, they can save a lot of energy.
The way I think about it now is to add the final generated css file to the theme. Is there a best practice to solve this problem?
hugo mod vendor saves the Hugo module locally in your site directory, it does not do any dependency management. If you are using PostCSS to build the CSS file of your theme, you would still need to have that installed (and other npm dependencies such as tailwind).
I am thinking about checking the generated css file first. If exists, I will just use this file and use PostCSS if it does not exist. I think this may solve the problem? And I am also wondering if it is a best practice for this case.
I find that if I use useResourceCacheWhen = "always", it can perform well. But fallback does not.
In my understanding, fallback use cache when the build falls (do not have extended version, modules for PoatCSS, etc.)? But when I use fallback, I just get those normal errors like: Error: Cannot find module 'xxx' and it seems that the cache has not been used.