dk00 / livescript-next

Enable latest ES features for LiveScript

Home Page:https://lsn.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

export default

IamCarbonMan opened this issue · comments

There is no way to set the default ES6 export. export {x as default} is not the same as export default x.

Yes, we can't express export default x now. I'm using export default: x for default export, this compiles to export {x as default}, and it can be imported by import 'path/to/module': x. rollup and webpack are also happy with this.

There are some possible ways to implement this:

  1. export x, y, z is not implemented yet, we can make export x.y z compiles to export default x.y(z), but If we choose this, then we can't use named exports without braces like this: export x, y, z to export {x, y, z}
  2. export default doesn't parse now, we add this to the grammar like CoffeeScript 2 does, make export default something compiles as-is.

Add your reaction with laugh to vote 0, hooray to vote 1.

Any ideas?