Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uglify error SyntaxError: Unexpected token: operator (>) #460

Closed
Bnaya opened this issue Jan 29, 2017 · 5 comments
Closed

Uglify error SyntaxError: Unexpected token: operator (>) #460

Bnaya opened this issue Jan 29, 2017 · 5 comments
Assignees

Comments

@Bnaya
Copy link

Bnaya commented Jan 29, 2017

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

@nponiros
Copy link
Collaborator

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.

@dfahlander dfahlander self-assigned this Jan 30, 2017
@dfahlander
Copy link
Collaborator

dfahlander commented Jan 30, 2017

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

dfahlander added a commit that referenced this issue Jan 30, 2017
Best practice seems to be not to deliver ES6 modules but ESM modules (just ES module syntax but not other non-ES5 code).
Resolves #460.
@dfahlander
Copy link
Collaborator

dfahlander commented Jan 30, 2017

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)

@dfahlander
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants