Skip to content
Permalink
Browse files

When converting the source to AMD, don't forget to AMD

  • Loading branch information...
timmywil committed Aug 16, 2013
1 parent 338e48a commit b693b370a459ef89ef187518b832a45b6e848eca
Showing with 14 additions and 4 deletions.
  1. +5 −2 build/tasks/build.js
  2. +7 −1 src/exports/amd.js
  3. +2 −1 src/jquery.js
@@ -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;
@@ -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;
});
}
}

});
@@ -27,7 +27,8 @@ define([
"./effects/animated-selector",
"./offset",
"./dimensions",
"./deprecated"
"./deprecated",
"./exports/amd"
], function( jQuery ) {

// Expose jQuery and $ identifiers, even in

0 comments on commit b693b37

Please sign in to comment.
You can’t perform that action at this time.