Commit 2f985ff8 authored by Timmy Willison's avatar Timmy Willison

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

parent 993418e9
...@@ -57,10 +57,13 @@ module.exports = function( grunt ) { ...@@ -57,10 +57,13 @@ module.exports = function( grunt ) {
} }
// Remove define wrappers, closure ends, and empty declarations // Remove define wrappers, closure ends, and empty declarations
// Unless it's the proper AMD define
contents = contents contents = contents
.replace( /define\([^{]*?{/, "" ) .replace( /define\([^{]*?{/, "" )
.replace( rdefineEnd, "" ) .replace( rdefineEnd, "" );
// Remove empty definitions
// Remove empty definitions
contents = contents
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
} }
return contents; return contents;
......
define([
"../core"
], function( jQuery ) {
// Register as a named AMD module, since jQuery can be concatenated with other // 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 // 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 // understands anonymous AMD modules. A named AMD is safest and most robust
...@@ -9,4 +13,6 @@ if ( typeof define === "function" && define.amd ) { ...@@ -9,4 +13,6 @@ if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function() { define( "jquery", [], function() {
return jQuery; return jQuery;
}); });
} }
\ No newline at end of file
});
\ No newline at end of file
...@@ -27,7 +27,8 @@ define([ ...@@ -27,7 +27,8 @@ define([
"./effects/animated-selector", "./effects/animated-selector",
"./offset", "./offset",
"./dimensions", "./dimensions",
"./deprecated" "./deprecated",
"./exports/amd"
], function( jQuery ) { ], function( jQuery ) {
// Expose jQuery and $ identifiers, even in // Expose jQuery and $ identifiers, even in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment