How to properly set up Coffeescript with Node.js

后端 未结 1 916
[愿得一人]
[愿得一人] 2021-01-18 18:30

I\'m trying to define some Node routes using Coffeescript in the following way:

My app.js file:

/**
 * Module dependencies.
 */

require(\'coffee-scr         


        
相关标签:
1条回答
  • 2021-01-18 19:13

    In CoffeeScript 1.7, the line require('coffee-script') no longer allows you to require CoffeeScript files. Instead, you need to either:

    require('coffee-script/register')
    

    or

    require('coffee-script').register()
    

    See the documentation.

    0 讨论(0)
提交回复
热议问题