mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Merge pull request #338 from jrburke/optamd
Optionally call AMD define() to register module
This commit is contained in:
@@ -56,6 +56,14 @@
|
|||||||
exports = module.exports = _;
|
exports = module.exports = _;
|
||||||
}
|
}
|
||||||
exports._ = _;
|
exports._ = _;
|
||||||
|
} else if (typeof define === 'function' && define.amd) {
|
||||||
|
// Register as a module with AMD. Use a named module since underscore
|
||||||
|
// can be used in optimization schemes that do not understand anonymous
|
||||||
|
// modules, and the if it is used on a page with an AMD loader, a load
|
||||||
|
// error could occur.
|
||||||
|
define('underscore', function() {
|
||||||
|
return _;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// Exported as a string, for Closure Compiler "advanced" mode.
|
// Exported as a string, for Closure Compiler "advanced" mode.
|
||||||
root['_'] = _;
|
root['_'] = _;
|
||||||
|
|||||||
Reference in New Issue
Block a user