]> source.dussan.org Git - jquery.git/commitdiff
When converting the source to AMD, don't forget to AMD
authorTimmy Willison <timmywillisn@gmail.com>
Fri, 16 Aug 2013 16:54:43 +0000 (12:54 -0400)
committerTimmy Willison <timmywillisn@gmail.com>
Fri, 16 Aug 2013 16:56:33 +0000 (12:56 -0400)
build/tasks/build.js
src/exports/amd.js
src/jquery.js

index 753ca60dca3d702517d0f4a2c6b0afa1fea9eaa8..adbc3092369603d96f871738c9296fb138401ebc 100644 (file)
@@ -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, "" )
-                               // Remove empty definitions
+                               .replace( rdefineEnd, "" );
+
+                       // Remove empty definitions
+                       contents = contents
                                .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
                }
                return contents;
index abd874e81ada41f2fc4dbce96e96ef25ab65f58d..4499d2defc5fb4f661730f8b2dd693c0120d6e07 100644 (file)
@@ -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
@@ -9,4 +13,6 @@ if ( typeof define === "function" && define.amd ) {
        define( "jquery", [], function() {
                return jQuery;
        });
-}
\ No newline at end of file
+}
+
+});
\ No newline at end of file
index 644f2925561f43162dad842630d31c8c9f811ccf..2c63e36060e3f99d7b3047b447043cf0bc36f8dd 100644 (file)
@@ -27,7 +27,8 @@ define([
        "./effects/animated-selector",
        "./offset",
        "./dimensions",
-       "./deprecated"
+       "./deprecated",
+       "./exports/amd"
 ], function( jQuery ) {
 
 // Expose jQuery and $ identifiers, even in