Skip to content

Something is wrong with "default" #4481

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

Closed
audinue opened this issue Apr 1, 2017 · 1 comment
Closed

Something is wrong with "default" #4481

audinue opened this issue Apr 1, 2017 · 1 comment

Comments

@audinue
Copy link

audinue commented Apr 1, 2017

// foo.js
export default function foo () {
    console.log('foo')
}
// bar.js
export { default as foo } from './foo'
// baz.js
import { foo } from './bar'
foo()

Works as expected. However...

# foo.coffee
export default foo = ->
    console.log 'foo'
# bar.coffee
export { default as foo } from './foo'
# baz.coffee
import { foo } from './bar'
do foo

Throws: Error transforming bar.coffee: unexpected identifier

This might be related to #4451

The workaround is simply put the backticks around. Or...

import foo from './foo' # Too much work but doable :)
export { foo }

Why do I use CoffeeScript instead of TypeScript and encourage my friends to do so?

Because with CoffeeScript we get the money, quickly. Instead of thinking the unnecessaries and being overwhelmed by code organization and stuffs and being poor software engineers.

Thank you for listening.

@audinue
Copy link
Author

audinue commented Apr 6, 2017

Thank you @GeoffreyBooth and @lydell !

You guys are awesome!

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

1 participant