Javascript/jquery file does not get minfied when it included comments

It seems to me that when I try to minify a javascript file that contains comments, it does not work. It is at least not converted to a single line.

This is the code I am using (borrowed from this forum):

{{ $jquery := resources.Get "jquery/dist/jquery.js" }}

{{ $main := slice $jquery | resources.Concat "main.js" }}

{{ if not .Site.IsServer }}
  {{ $main = $main | minify| fingerprint }}
{{ end }} 
<script src="{{ $main.Permalink }}" {{ with $main.Data.Integrity }} integrity="{{ . }}"{{ end }}></script>

Is this expected behavior? If so, is there a way to strip out comments from a javascript file in Go?

For clarification, I am looking at the js script after building the site with hugo, and not in server mode. The file is called: public/main.min.113c5b7b912cd8902a5e634df103f165efee5d57a74b96687985264289fd7752.js

The JS minifier is not the most advanced minifier. It will do some basic minification to shave off ~30% of your file. Most of the newlines are not removed (a newlines is significant in JS code), which is why you’re not seeing a single-line output. Comments should be removed though (unless it starts with an exclamation mark if I remember correctly), please confirm whether the minifier works or not by checking the difference in size before and after.

A more advanced JS parser is being planned.