Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -27,12 +27,10 @@ define([ | ||
"./offset", | ||
"./dimensions", | ||
"./deprecated", | ||
"./exports/amd", | ||
"./exports/global" | ||
], function( jQuery ) { | ||
|
||
return jQuery; | ||
|
||
}); |