CoffeeScript comes to CfStatic
.coffee extension, and CfStatic will do the rest.
By default, CoffeeScript will wrap the compiled
.js in an anonymous function call to ensure no leaked variables:
However, it offers a “bare mode” switch so that the anonymous function wrapper is not included should you really need to have the variables available globally (which they do not recommend). In CfStatic, simply name your CoffeeScript files with the
.bare.coffee extension to have them compiled in bare mode.
CfStatic JavaDoc comments in CoffeeScript
If you use CfStatic already, you’ll know that your static files need marking up with JavaDoc style comments that look like this:
Unfortunately, this style of comment is not valid in CoffeeScript. Instead, you will need to markup the comments as follows:
It’s still in Beta
This release takes CfStatic to 0.5.0, so still experimental. I have not had a chance to really play around with CoffeeScript but if you do, and encounter problems or have ideas, please submit issues to the GitHub repository.