Skip to content

Commit 4208f0b

Browse files
committed
same export as original jqueryify
1 parent 5b39bb2 commit 4208f0b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9764,16 +9764,13 @@ jQuery.fn.size = function() {
97649764
jQuery.fn.andSelf = jQuery.fn.addBack;
97659765

97669766
// })();
9767-
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
9767+
if ( typeof module === "object" && typeof module.exports === "object" ) {
97689768
// Expose jQuery as module.exports in loaders that implement the Node
97699769
// module pattern (including browserify). Do not create the global, since
97709770
// the user will be storing it themselves locally, and globals are frowned
97719771
// upon in the Node module world.
97729772
module.exports = jQuery;
97739773
} else {
9774-
// Otherwise expose jQuery to the global object as usual
9775-
window.jQuery = window.$ = jQuery;
9776-
97779774
// Register as a named AMD module, since jQuery can be concatenated with other
97789775
// files that may use define, but not via a proper concatenation script that
97799776
// understands anonymous AMD modules. A named AMD is safest and most robust
@@ -9786,7 +9783,12 @@ if ( typeof module === "object" && module && typeof module.exports === "object"
97869783
}
97879784
}
97889785

9786+
// If there is a window object, that at least has a document property,
9787+
// define jQuery and $ identifiers
9788+
if ( typeof window === "object" && typeof window.document === "object" ) {
9789+
window.jQuery = window.$ = jQuery;
9790+
}
9791+
97899792
})( window );
97909793

97919794
module.exports = window.jQuery;
9792-

0 commit comments

Comments
 (0)