Permalink
Show file tree
Hide file tree
2 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
25 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
// Expose jQuery to the global object | ||
window.jQuery = window.$ = jQuery; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// Expose jQuery as module.exports in loaders that implement the Node | ||
// module pattern (including browserify). Do not create the global, since | ||
// the user will be storing it themselves locally, and globals are frowned | ||
// upon in the Node module world. | ||
module.exports = jQuery; | ||
} else { | ||
// Otherwise expose jQuery to the global object as usual | ||
window.jQuery = window.$ = jQuery; | ||
|
||
// Expose jQuery as an AMD module, but only for AMD loaders that | ||
// understand the issues with loading multiple versions of jQuery | ||
// in a page that all might call define(). The loader will indicate | ||
// they have special allowances for multiple jQuery versions by | ||
// specifying define.amd.jQuery = true. Register as a named module, | ||
// since jQuery can be concatenated with other files that may use define, | ||
// but not use a proper concatenation script that understands anonymous | ||
// AMD modules. A named AMD is safest and most robust way to register. | ||
// Lowercase jquery is used because AMD module names are derived from | ||
// file names, and jQuery is normally delivered in a lowercase file name. | ||
// Do this after creating the global so that if an AMD module wants to call | ||
// noConflict to hide this version of jQuery, it will work. | ||
if ( typeof define === "function" && define.amd && define.amd.jQuery ) { | ||
define( "jquery", [], function () { return jQuery; } ); | ||
// Expose jQuery as an AMD module, but only for AMD loaders that | ||
// understand the issues with loading multiple versions of jQuery | ||
// in a page that all might call define(). The loader will indicate | ||
// they have special allowances for multiple jQuery versions by | ||
// specifying define.amd.jQuery = true. Register as a named module, | ||
// since jQuery can be concatenated with other files that may use define, | ||
// but not use a proper concatenation script that understands anonymous | ||
// AMD modules. A named AMD is safest and most robust way to register. | ||
// Lowercase jquery is used because AMD module names are derived from | ||
// file names, and jQuery is normally delivered in a lowercase file name. | ||
// Do this after creating the global so that if an AMD module wants to call | ||
// noConflict to hide this version of jQuery, it will work. | ||
if ( typeof define === "function" && define.amd && define.amd.jQuery ) { | ||
define( "jquery", [], function () { return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
})( window ); | ||
})( this ); |
a128355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broke the build😜
Add
/*global module */
.a128355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course it did... I assumed everything was in proper order. Thanks for the heads up