By default magnolia is configured to (gzip) compress html, js, and css resources. This is configured at: /modules/cache/config/compression/voters/contentType/allowed
Ensure that the same mimetype is used for JS everywhere.
Also check the rest of the configuration for potential js mime-type misconfiguration - for example:
Run magnolia locally. (Our public demo seems to compress JS in another way.)
Open a page in chrome - like http://localhost:8080/magnoliaAuthor/travel/about.html
Open the devtools and switch to "network" tab.
Click on a css file, (like: bootstrap.min....css) And notice Response Headers has Content-Encoding: gzip.
Click on a js file (like respimage.min...js) And notice that Response Headers has no Content-Encoding (Note that this file is 8634 bytes when not compressed, and around 4000 when compressed.
Big thanks to Marvin Kerkhoff for reporting.