File suffixes supported by --minify flag

“hugo --minify” doesn’t seem to auto-minify .css and .js assets. Do I have to do something special to get this flag to minify these? (If not, I’ll go back to piping each asset into resources.Minify…)


hugo --minify doesn’t minify static files in your static folder:

Files that get served statically (as-is, no modification) on the site root.

This is in the assets folder, not static.

My expected behavior is that --minify would attempt to minify all supported, non-minified files outside the static folder, and it would do it in-place (as it does for HTML files). That is, in-place minify assets/*.css but leave assets/*.min.css unmodified.

I am finding that --minify only in-place minifies HTML, XML, and JSON (?). Seems kinda broken, if you ask me–it’s not auto-minifiying all the filetypes supported by resources.Minify!

The reason I tried to use --minify to minify my assets in-place is because I don’t want the .min extension on my files. resources.Minify adds .min to each file and I have to rename the files in post-processing.

The docs don’t really say what the expected behavior of --minify is or should be. So: what is its expected behavior if not to attempt to in-place minify all supported, non-minified files outside the static folder?

minify any supported output format (HTML, XML etc.)

CSS files are not an output format in /content.

Ah, now I get what that flag does, thanks. Wish it did what I intuitively want it to do, but I will move on.