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

Use old syntax for defaut export object syntax #206

Closed
wants to merge 1 commit into from

Conversation

jakebailey
Copy link
Member

Fixes #205

The default export is an expression, so the { ... } is actually an object literal (not export names); as such, older runtimes may not support the shorthand object literal syntax. Duplicate the names to keep it working.

@andrewbranch
Copy link
Member

Object literal shorthand properties are in the same language spec as export default, so I would be 100% ok with not taking this “fix,” but I won’t fight against it if others think it’s worth it. Presumably a (super old?) version of Uglify was seeing a source string that already had module syntax transformed down or away, but still had other ES2015+ syntax in it. Not a big fan of avoiding ES6 syntax in a file that literally has ES6 in the name and isn’t the default entrypoint.

@andrewbranch
Copy link
Member

super old?

Uh, yeah

  • webpack 2.7.0
  • uglify-js 2.8.29

@jakebailey
Copy link
Member Author

Object literal shorthand properties are in the same language spec as export default

TIL! I thought it came separately.

@andrewbranch
Copy link
Member

My bad, I forgot you had already opened this PR when I merged #216

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

Successfully merging this pull request may close these issues.

ERROR in bundle from UglifyJs Unexpected token: punc (,)
2 participants