Permalink
Please
sign in to comment.
Browse files
Build: Add the ability to remove global exposure.
Ref #14016
- Loading branch information
Showing
with
40 additions
and 23 deletions.
- +1 −0 README.md
- +7 −0 build/tasks/build.js
- +0 −18 src/core.js
- +29 −0 src/exports/global.js
- +3 −5 src/jquery.js
@@ -0,0 +1,29 @@ | ||
define([ | ||
"../core" | ||
], function( jQuery ) { | ||
|
||
var | ||
// Map over jQuery in case of overwrite | ||
_jQuery = window.jQuery, | ||
|
||
// Map over the $ in case of overwrite | ||
_$ = window.$; | ||
|
||
jQuery.noConflict = function( deep ) { | ||
if ( window.$ === jQuery ) { | ||
window.$ = _$; | ||
} | ||
|
||
if ( deep && window.jQuery === jQuery ) { | ||
window.jQuery = _jQuery; | ||
} | ||
|
||
return jQuery; | ||
}; | ||
|
||
// Expose jQuery and $ identifiers, even in | ||
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) | ||
// and CommonJS for browser emulators (#13566) | ||
window.jQuery = window.$ = jQuery; | ||
|
||
}); |
0 comments on commit
a6f474e