Is there a way to include file in coffee script?

后端 未结 6 1510
温柔的废话
温柔的废话 2020-12-16 10:10

I\'d like to know if there is a way to include a file in a coffee script. Something like #include in C or require in PHP...

6条回答
  •  太阳男子
    2020-12-16 11:00

    How about coffeescript-concat?

    coffeescript-concat is a utility that preprocesses and concatenates CoffeeScript source files.

    It makes it easy to keep your CoffeeScript code in separate units and still run them easily. You can keep your source logically separated without the frustration of putting it all together to run or embed in a web page. Additionally, coffeescript-concat will give you a single sourcefile that will easily compile to a single Javascript file.

提交回复
热议问题