strues/retinajs

Cannot minify JS for retina.js

oliveratgithub opened this issue · 2 comments

Minifying retina.js is not working: when trying to with the code v2.1.0 using https://jscompress.com it fails with the following error:

SyntaxError: Unexpected token: punc ()) (line: 107, col: 38)

Referring to the following part of the code:

testImage.addEventListener('load', () => {

Also checked with https://javascript-minifier.com but getting the same error, so it's definitely in the code I assume.

You're using the source version, which is written in ES2015. Either use retina.js from the dist folder or add Babel to your build script to transpile it before minification.

Same here, I am using the latest npm package of retinajs.
package.json contains "main": "./dist/retina", and that is a transpiled code so it should be OK.

Maybe babel/webpack misconfiguration? Any tips?