livescript-next
livescript-next copied to clipboard
export default
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:
-
export x, y, zis not implemented yet, we can makeexport x.y zcompiles toexport default x.y(z), but If we choose this, then we can't use named exports without braces like this:export x, y, ztoexport {x, y, z} -
export defaultdoesn't parse now, we add this to the grammar like CoffeeScript 2 does, makeexport default somethingcompiles as-is.
Add your reaction with laugh to vote 0, hooray to vote 1.
Any ideas?