aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-03-07 09:55:26 -0500
committerTimmy Willison <timmywillisn@gmail.com>2014-03-07 09:55:26 -0500
commit984f77a930aa322bcc277762303370d7a2a4667a (patch)
tree661819d6ca286394cf457a806531d1198a437cbd /build
parent2df1aad6a1c9376c2a477eba26ee992113ed1c23 (diff)
downloadjquery-984f77a930aa322bcc277762303370d7a2a4667a.tar.gz
jquery-984f77a930aa322bcc277762303370d7a2a4667a.zip
Build: Fix AMD option for custom builds
Fixes #14859
Diffstat (limited to 'build')
-rw-r--r--build/tasks/build.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index e5794fe93..fa164cf92 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -55,12 +55,6 @@ module.exports = function( grunt ) {
// Remove EXPOSE lines from Sizzle
.replace( /\/\/\s*EXPOSE[\w\W]*\/\/\s*EXPOSE/, "return Sizzle;" );
- // AMD Name
- } else if ( (amdName = grunt.option( "amd" )) != null && /^exports\/amd$/.test( name ) ) {
- // Remove the comma for anonymous defines
- contents = contents
- .replace( /(\s*)"jquery"(\,\s*)/, amdName ? "$1\"" + amdName + "\"$2" : "" );
-
} else {
// Ignore jQuery's exports (the only necessary one)
@@ -87,6 +81,18 @@ module.exports = function( grunt ) {
contents = contents
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
}
+ // AMD Name
+ if ( (amdName = grunt.option( "amd" )) != null && /^exports\/amd$/.test( name ) ) {
+ if (amdName) {
+ grunt.log.writeln( "Naming jQuery with AMD name: " + amdName );
+ } else {
+ grunt.log.writeln( "AMD name now anonymous" );
+ }
+ // Remove the comma for anonymous defines
+ contents = contents
+ .replace( /(\s*)"jquery"(\,\s*)/, amdName ? "$1\"" + amdName + "\"$2" : "" );
+
+ }
return contents;
}