从.coffee编译后,在.js文件中维护注释

typ*_*ror 7 node.js coffeescript

我想在输出的JavaScript文件中保留我在CoffeeScript文件中写的注释.我怎样才能做到这一点?

#!/usr/bin/env bash

./node_modules/.bin/coffee --output lib/ --compile --bare --watch src/
Run Code Online (Sandbox Code Playgroud)

Lin*_*iel 11

咖啡脚本文档:

阻止注释heredocs语法的块注释将保留在生成的代码中.

这(借用下面的typeonerror的回复 - 整洁!):

###*
# This will be preserved in a block comment in the javascript
###
Run Code Online (Sandbox Code Playgroud)

编译到:

/**
 * This will be preserved in a block comment in the javascript
 */
Run Code Online (Sandbox Code Playgroud)