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 = """
|
code = """
|
||||||
this.CoffeeScript = function() {
|
(function(root) {
|
||||||
function require(path){ return require[path]; }
|
var CoffeeScript = function() {
|
||||||
#{code}
|
function require(path){ return require[path]; }
|
||||||
return require['./coffee-script']
|
#{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'
|
unless process.env.MINIFY is 'false'
|
||||||
{parser, uglify} = require 'uglify-js'
|
{parser, uglify} = require 'uglify-js'
|
||||||
|
|
Loading…
Reference in New Issue