Is there out any flag in the CoffeeScript compiler to add single-line coffee comments to Javascript output? I read some time ago it would be supported but it turns out this option still remains unavailable.
The easiest option is just to use block comments everywhere. A search/replace across your code base could take care of this in a trivially short time. You would change
# coffeescript one-line comment, not passed through to js
into this
### coffeescript block comment, which IS passed through to js ###
A harder option would be to mod coffeescript itself. For instance, the coffeescript lexer is very well documented, and shows that the logic used to identify block comments. By carefully modifying the lexer, I imagine you could convince it that your single line comments were block comments, which again, are already passed through to js. I haven't tried this, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With