Skip to content

Commit

Permalink
Add more mimetypes that can be used for JavaScript including module, f…
Browse files Browse the repository at this point in the history
…ixes #482
  • Loading branch information
tdewolff committed May 2, 2022
1 parent dce0132 commit 3fad17c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion bindings/js/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go build -buildmode=c-archive -o minify.a minify.go
version=$(cat go.mod | grep github.com/tdewolff/minify/v2 | cut -d ' ' -f 2 | cut -b 2-)
sed -i "s/0.0.0/$version/" package.json

export NODE_PRE_GYP_GITHUB_TOKEN=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
export PATH=./node_modules/@mapbox/node-pre-gyp/bin:./node_modules/node-pre-gyp-github/bin:$PATH
node-pre-gyp configure
node-pre-gyp build
Expand Down
2 changes: 1 addition & 1 deletion cmd/minify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func run() int {
m.Add("text/css", cssMinifier)
m.Add("text/html", htmlMinifier)
m.Add("image/svg+xml", svgMinifier)
m.AddRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), jsMinifier)
m.AddRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma|j|live)script(1\\.[0-5])?$|^module$"), jsMinifier)
m.AddRegexp(regexp.MustCompile("[/+]json$"), jsonMinifier)
m.AddRegexp(regexp.MustCompile("[/+]xml$"), xmlMinifier)

Expand Down

0 comments on commit 3fad17c

Please sign in to comment.