mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +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._ = _;
|
||||
} 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 {
|
||||
// Exported as a string, for Closure Compiler "advanced" mode.
|
||||
root['_'] = _;
|
||||
|
||||
Reference in New Issue
Block a user