Added AMD support.
This commit is contained in:
parent
a6081caf50
commit
3564f51fb5
16
Cakefile
16
Cakefile
|
@ -104,11 +104,17 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
|
|||
};
|
||||
"""
|
||||
code = """
|
||||
this.CoffeeScript = function() {
|
||||
function require(path){ return require[path]; }
|
||||
#{code}
|
||||
return require['./coffee-script']
|
||||
}()
|
||||
(function(root) {
|
||||
var CoffeeScript = function() {
|
||||
function require(path){ return require[path]; }
|
||||
#{code}
|
||||
return require['./coffee-script']
|
||||
}();
|
||||
|
||||
if(typeof define === 'function' && define.amd) {
|
||||
define(function() { return CoffeeScript });
|
||||
} else { root.CoffeeScript = CoffeeScript }
|
||||
}(this));
|
||||
"""
|
||||
unless process.env.MINIFY is 'false'
|
||||
{parser, uglify} = require 'uglify-js'
|
||||
|
|
Loading…
Reference in New Issue