aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2013-09-08 22:26:05 -0400
committerTimmy Willison <timmywillisn@gmail.com>2013-09-08 22:26:05 -0400
commit8791920183f9f13a7be1d513652b9c96d29648c7 (patch)
tree8976bca237c6f87f73cadee02810923ebadf46c5
parentd4518eacb0b5aa2bddf9812559debe2bdc1bd334 (diff)
downloadjquery-8791920183f9f13a7be1d513652b9c96d29648c7.tar.gz
jquery-8791920183f9f13a7be1d513652b9c96d29648c7.zip
Restore optIn behavior for builds
-rw-r--r--build/tasks/build.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index ffc1243ba..9f4f429ea 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -23,6 +23,7 @@ module.exports = function( grunt ) {
startFile: "src/intro.js",
endFile: "src/outro.js"
},
+ rawText: {},
onBuildWrite: convert
};
@@ -75,6 +76,7 @@ module.exports = function( grunt ) {
var flag, index,
done = this.async(),
flags = this.flags,
+ optIn = flags[ "*" ],
name = this.data.dest,
minimum = this.data.minimum,
removeWith = this.data.removeWith,
@@ -168,18 +170,15 @@ module.exports = function( grunt ) {
// *:*:-css all except css and dependents (explicit > implicit)
// *:*:-css:+effects same (excludes effects because explicit include is trumped by explicit exclude of dependency)
// *:+effects none except effects and its dependencies (explicit include trumps implicit exclude of dependency)
+ delete flags[ "*" ];
for ( flag in flags ) {
- if ( flag !== "*" ) {
- excluder( flag );
- }
+ excluder( flag );
}
// Handle Sizzle exclusion
// Replace with selector-native
if ( (index = excluded.indexOf( "sizzle" )) > -1 ) {
- config.rawText = {
- selector: "define(['./selector-native']);"
- };
+ config.rawText.selector = "define(['./selector-native']);";
excluded.splice( index, 1 );
}
@@ -213,6 +212,12 @@ module.exports = function( grunt ) {
grunt.file.write( name, compiled );
};
+ // Turn off opt-in if necessary
+ if ( !optIn ) {
+ // Overwrite the default inclusions with the explicit ones provided
+ config.rawText.jquery = "define([" + (included.length ? included.join(",") : "") + "]);";
+ }
+
// Trace dependencies and concatenate files
requirejs.optimize( config, function( response ) {
grunt.verbose.writeln( response );