Found this post about possibly a similar error, but there’s no point in pretending I get what’s going on with that one. Better I post the code and error here and hope you guys see again what I don’t.
The offending code ($listPageTypes is a slice earlier defined with Types for the paginator):
On the topic of the update, while I have you here, I found npm uglifying and concatenating prior to minifying and fingerprinting in hugo production build worked great.
Now this js.Build thing does basically the same as npm uglify, only faster (and in the hugo pipe)?
Obviously that’s a yes, but if you could print a big fat yes after this that would be great (npm uglify doesn’t stand up to js.Build)?
i never compared the output of npm uglify vs js.Build.
as js.Build is based on esbuild, you may want to read all it’s capabilities on the esbuild repo readme.
I’m not heavy js user, i only include small js libs + my own code to hook html element, so it’s pretty simple.
i would say YES,
the ability to bundle and minify javascript without running nodejs is already 100+ points for me.
Good to know, thanks. I don’t use a ton of javascript either. I’m using mostly PHP on the backend for dynamic server side. Looking forward to learning more about integrating dynamic server-side action with hugo builds under the same url. If I had more time I would love to learn more go!
I use npm html-minifier instead of hugo minifier. Didn’t yet mess around too much with hugo minifier options, but html-minifier was better output when I did. Build is scripted and shortcutted, so not a big problem, but will be nice to cut out the npm javascript uglifier anyway.