When caddy runs and I go to localhost I get the following error in my Chrome web browser console:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
So it seems Caddy is giving the wrong MIME type for my Javascript file. It should give application/javascript.
Your config works for me, with the main difference being that I don’t use Windows – does Windows have some sort of system MIME types file that the Go standard lib can load its file associations from?