I’m developing a theme using postcss, tailwind and a few other bits. This requires me to use npm to install the various required packages, which is fine. But, my problem is this only seems to work if you run npm i postcss-cli
from the root directory for the hugo site. I also have to place my postcss.config.js
file within the root directory.
I’m not comfortable doing this as such packages have nothing to do with hugo and more to do with the theme. If I want to upload my theme to github to share with others the user would have to manually install the npm packages within their root hugo directory.
I think a better solution would be allow the user to provide a path to the configuration, or default to root directory.
That way I can upload the theme along with the package.json
and postcss.config.js
and the user can just run npm install
from within that directory and everything will be setup fine.
Maybe this is already possible. But I can’t seem to find anything in the documentation.
Basically what I want to do is store the package.json
, node_modules
, postcss.config.js
etc under /hugo-website/themes/my-custome/theme/node_modules
… rather than /hugo-website/node_modules
.
Thoughts?