Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Coffeescript with Ember App Kit?

I am trying to use Coffeescript with ember app kit but it's blowing up when I rename router.js to router.coffee. I am assuming it has to do something with the emc6 module syntax. How do I properly convert it?

Router = Ember.Router.extend()
Router.map ->
  @route "component-test"
  @route "helper-test"

export default Router
like image 289
Ecl1pse Armageddon Avatar asked Nov 15 '13 07:11

Ecl1pse Armageddon


1 Answers

As CoffeScript currently can't parse ES6 module syntax, wrap your import/export statements with backticks:

`export default Router`

Hopefully that alone will get it working for you.

like image 69
zeppelin Avatar answered Nov 08 '22 19:11

zeppelin