Is it possible to obfuscate/minify variable names in default minification in hugo

Hi, is it possible to convert lengthy javascript variable & function names to smaller alphabeticals by means of javascript obfuscation in hugo? Is it supported with the default asset minification provided by hugo?

See https://github.com/tdewolff/minify#js.

2 Likes

@jmooring is right, but as to JavaScript, I experience that setting minify=true in js.Build does a better job:

Heads up. There’s an unresolved fingerprinting issue related to minifying twice:

https://github.com/gohugoio/hugo/issues/8370

The workaround here was to disable js.Build minification, but there may have been another way around the problem.

That is issue is not about minification, but I would say that in general it is a bad idea to minify twice.

Yeah, I figured out how to make it stop happening, but I had no clue why it was happening.

Thanks for those links to repos!
It was useful