Dexie.js: Uglify error SyntaxError: Unexpected token: operator (>)

Created on 29 Jan 2017  路  5Comments  路  Source: dfahlander/Dexie.js

The code that provided in package.json.module / package.json.es:next needs to be a valid es5 code, except of the es6 modules syntax. (as rollup guidelines )

Currently its contain other es6 features as arrow functions.

When Uglifying js code that contains also dexie code it breaks with that following error:
SyntaxError: Unexpected token: operator (>) because of an error function

That error didn't happen with dexie beta.7 but with beta.9

Most helpful comment

Using extension dexie.es.js instead of dexie.jsm. Reasons:

  • jsm extension is not yet standardized and code editors doesn't detect that it is JS.
  • rollupjs distributes its own ES modules as with 'es.js' file extension.

(Previous releases did have dexie.es6.js)

All 5 comments

Rollup guidelines
https://github.com/rollup/rollup/wiki/pkg.module#wait-it-just-means-import-and-export--not-other-future-javascript-features

Thanks for the info @Bnaya . I guess we shouldn't target es2015 in the build script, just es2015 modules and target es5 for the rest.

The name of the module (currently dexie.es6.js) is inaccurate if so. Seems we should name it dexie.jsm?

Using extension dexie.es.js instead of dexie.jsm. Reasons:

  • jsm extension is not yet standardized and code editors doesn't detect that it is JS.
  • rollupjs distributes its own ES modules as with 'es.js' file extension.

(Previous releases did have dexie.es6.js)

Side note: Now also configured the addons to produce es.js outputs.

Was this page helpful?
0 / 5 - 0 ratings