Best practice on static asset bundling

Moving my blog over to hugo I decided to ignore things as trivial as how assets are bundled and just included each of them as scripts in the JS but I also write styles in Sass. Is there any recommend way to have hugo compile Sass to CSS? If no, I could use gulp or webpack but can I make the static asset updates to affect visual change on live reload like it is with posts?

It does not have a way to trigger a build chain, although that has been discussed iirc. You trigger that however you need to, and just use the built in web server to view the changes as they happen.

Thanks. Got that

I just have sass --watch run in a second Terminal window while Iā€™m fiddling with CSS. The first window runs hugo serve -w.

More specifically, sass -I static/CSS/ --no-cache --watch static/CSS/all.scss:static/CSS/all.css. Season to taste.

1 Like

I would just go with a solution like in this repo Hugo Boilerplate with gulp + webpack and swap the postcss gulp module with sass.


I was gonna use gulp but gulp + webpack? That looks interesting