resolve collision with existing requireJS on the page
This commit is contained in:
parent
1b61d635b8
commit
1e8a366cd5
1 changed files with 3 additions and 8 deletions
|
|
@ -47,12 +47,6 @@ var global = (function() {
|
||||||
return this;
|
return this;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// if we find an existing require function use it.
|
|
||||||
if (global.require && global.define) {
|
|
||||||
require.packaged = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var _define = function(module, deps, payload) {
|
var _define = function(module, deps, payload) {
|
||||||
if (typeof module !== 'string') {
|
if (typeof module !== 'string') {
|
||||||
if (_define.original)
|
if (_define.original)
|
||||||
|
|
@ -110,12 +104,13 @@ var _require = function(module, callback) {
|
||||||
return _require.original.apply(window, arguments);
|
return _require.original.apply(window, arguments);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
_require.packaged = true;
|
||||||
|
|
||||||
if (global.require)
|
if (global.require)
|
||||||
_require.original = global.require;
|
_require.original = global.require;
|
||||||
|
|
||||||
global.require = _require;
|
global.require = _require;
|
||||||
require.packaged = true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal function to lookup moduleNames and resolve them by calling the
|
* Internal function to lookup moduleNames and resolve them by calling the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue