mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
When converting the source to AMD, don't forget to AMD
This commit is contained in:
parent
338e48aea5
commit
b693b370a4
@ -57,10 +57,13 @@ module.exports = function( grunt ) {
|
||||
}
|
||||
|
||||
// Remove define wrappers, closure ends, and empty declarations
|
||||
// Unless it's the proper AMD define
|
||||
contents = contents
|
||||
.replace( /define\([^{]*?{/, "" )
|
||||
.replace( rdefineEnd, "" )
|
||||
.replace( rdefineEnd, "" );
|
||||
|
||||
// Remove empty definitions
|
||||
contents = contents
|
||||
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
|
||||
}
|
||||
return contents;
|
||||
|
@ -1,3 +1,7 @@
|
||||
define([
|
||||
"../core"
|
||||
], function( jQuery ) {
|
||||
|
||||
// Register as a named AMD module, since jQuery can be concatenated with other
|
||||
// files that may use define, but not via a proper concatenation script that
|
||||
// understands anonymous AMD modules. A named AMD is safest and most robust
|
||||
@ -10,3 +14,5 @@ if ( typeof define === "function" && define.amd ) {
|
||||
return jQuery;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
3
src/jquery.js
vendored
3
src/jquery.js
vendored
@ -27,7 +27,8 @@ define([
|
||||
"./effects/animated-selector",
|
||||
"./offset",
|
||||
"./dimensions",
|
||||
"./deprecated"
|
||||
"./deprecated",
|
||||
"./exports/amd"
|
||||
], function( jQuery ) {
|
||||
|
||||
// Expose jQuery and $ identifiers, even in
|
||||
|
Loading…
Reference in New Issue
Block a user