jashkenas/coffee-script — pull request #1826 by samcday (2011-11-05 10:59:43+00:00)
Title: Added AMD support.

Hi guys,

This is a simple patch to enable AMD loading for the browser version of coffee-script.js.

I've tested this in the browser (both included directly and via RequireJS). Just for laughs, I also tested it via the RequireJS r.js Node adapter - it works, though I don't suspect anyone would care as they should probably be using the npm package ;)

I was considering adding this support somewhere other than in the Cakefile build:browser target, but the RequireJS site recommends against letting r.js scan node_modules, instead it just uses standard Node require() calls. Given that CoffeeScript will almost always live in node_modules, I came to the conclusion that AMD support in the standard package is not really that useful.

I couldn't come up with an immediately obvious way to write a test for this, so I didn't write any :)

Thanks for your time.