Commit a289beb6 authored by Timmy Willison's avatar Timmy Willison

Restore optIn behavior for builds

Conflicts:
	build/tasks/build.js
parent a8627a92
...@@ -23,6 +23,7 @@ module.exports = function( grunt ) { ...@@ -23,6 +23,7 @@ module.exports = function( grunt ) {
startFile: "src/intro.js", startFile: "src/intro.js",
endFile: "src/outro.js" endFile: "src/outro.js"
}, },
rawText: {},
onBuildWrite: convert onBuildWrite: convert
}; };
...@@ -75,6 +76,7 @@ module.exports = function( grunt ) { ...@@ -75,6 +76,7 @@ module.exports = function( grunt ) {
var flag, var flag,
done = this.async(), done = this.async(),
flags = this.flags, flags = this.flags,
optIn = flags[ "*" ],
name = this.data.dest, name = this.data.dest,
minimum = this.data.minimum, minimum = this.data.minimum,
removeWith = this.data.removeWith, removeWith = this.data.removeWith,
...@@ -165,10 +167,9 @@ module.exports = function( grunt ) { ...@@ -165,10 +167,9 @@ module.exports = function( grunt ) {
// *:*:-css all except css and dependents (explicit > implicit) // *:*:-css all except css and dependents (explicit > implicit)
// *:*:-css:+effects same (excludes effects because explicit include is trumped by explicit exclude of dependency) // *:*:-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) // *:+effects none except effects and its dependencies (explicit include trumps implicit exclude of dependency)
delete flags[ "*" ];
for ( flag in flags ) { for ( flag in flags ) {
if ( flag !== "*" ) { excluder( flag );
excluder( flag );
}
} }
grunt.verbose.writeflags( excluded, "Excluded" ); grunt.verbose.writeflags( excluded, "Excluded" );
...@@ -201,6 +202,12 @@ module.exports = function( grunt ) { ...@@ -201,6 +202,12 @@ module.exports = function( grunt ) {
grunt.file.write( name, compiled ); 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 // Trace dependencies and concatenate files
requirejs.optimize( config, function( response ) { requirejs.optimize( config, function( response ) {
grunt.verbose.writeln( response ); grunt.verbose.writeln( response );
......
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