livescript-next icon indicating copy to clipboard operation
livescript-next copied to clipboard

export default

Open carboniris opened this issue 8 years ago • 1 comments

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

carboniris avatar Oct 29 '17 01:10 carboniris

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?

dk00 avatar Oct 29 '17 13:10 dk00