Repository: gohugoio/hugo (language: go)

Issue:
Add jsm and mjs extensions to application/javascript media type associations
Reference: <https://discourse.gohugo.io/t/37084>

Hugo does not currently associate the `.jsm` or `.mjs` extensions with the `application/javascript` media type.

When using `resources.GetRemote`, our content/extension validation is system-dependent, where the local MIME database is loaded and read. 

For example, on the OP's system, and on mine:

```bash
$ cat /usr/share/mime/globs2 | grep javascript

50:application/javascript:*.jsm
50:application/javascript:*.mjs
50:application/javascript:*.js
```

Hugo ends up with the _first_ one on the list.







Discussion / hints:

Fix patch:
diff --git a/media/mediaType.go b/media/mediaType.go
index 47a74ec567c..4fceac2220d 100644
--- a/media/mediaType.go
+++ b/media/mediaType.go
@@ -229,7 +229,7 @@ var (
 	SASSType       = newMediaType("text", "x-sass", []string{"sass"})
 	CSVType        = newMediaType("text", "csv", []string{"csv"})
 	HTMLType       = newMediaType("text", "html", []string{"html"})
-	JavascriptType = newMediaType("application", "javascript", []string{"js"})
+	JavascriptType = newMediaType("application", "javascript", []string{"js", "jsm", "mjs"})
 	TypeScriptType = newMediaType("application", "typescript", []string{"ts"})
 	TSXType        = newMediaType("text", "tsx", []string{"tsx"})
 	JSXType        = newMediaType("text", "jsx", []string{"jsx"})


Test patch: