How to use Coffeescript with the Ember App Kit?

I am trying to use Coffeescript with an ember application suite, but it explodes when I rename router.js to router.coffee. I guess it should do something with the syntax of the emc6 module. How to convert it correctly?

Router = Ember.Router.extend() Router.map -> @route "component-test" @route "helper-test" export default Router 
+6
source share
1 answer

Since CoffeScript currently cannot parse the syntax of the ES6 module, wrap your import / export statements with backlinks:

 `export default Router` 

Hope this only makes it work for you.

+5
source

Source: https://habr.com/ru/post/958130/


All Articles