RedditPP Mascot

RedditPP

r/gohugo • … • u/smog_alado

Avoiding NPM?

I've noticed that several popular themes depend on NPM; is there a way I can bypass that?

Many of the themes I found only use NPM to generate CSS via postCSS, but most of the people on my team are only writing markdown content and will never edit the CSS. Is there a way I could set things up so that they don't need NPM to build the site? That is, only require NPM if you want to edit the CSS. It's a shame because one of the main draws of Hugo was how easy it was to install and now I'd have to tell my colleagues that they must suffer the pain of node\_modules.

In a theme that uses a PostCSS pipeline, does Hugo rebuild the PostCSS every time, or does it only do so if the CSS changed? I tried copying the generated CSS into my static or assets folder but it didn't seem to help. "hugo server" still asked for NPM. :-/ I wonder if this is something that would require forking the theme and adding some if statements around the PostCSS template.

— 0