11/**
22 * Special concat/build task to handle various jQuery build requirements
3- * Concats AMD modules, removes their definitions, and includes/excludes specified modules
3+ * Concats AMD modules, removes their definitions,
4+ * and includes/excludes specified modules
45 */
56
67module . exports = function ( grunt ) {
@@ -35,7 +36,8 @@ module.exports = function( grunt ) {
3536 /**
3637 * Strip all definitions generated by requirejs
3738 * Convert "var" modules to var declarations
38- * "var module" means the module only contains a return statement that should be converted to a var declaration
39+ * "var module" means the module only contains a return
40+ * statement that should be converted to a var declaration
3941 * This is indicated by including the file in any "var" folder
4042 * @param {String } name
4143 * @param {String } path
@@ -98,7 +100,8 @@ module.exports = function( grunt ) {
98100
99101 grunt . registerMultiTask (
100102 "build" ,
101- "Concatenate source, remove sub AMD definitions, (include/exclude modules with +/- flags), embed date/version" ,
103+ "Concatenate source, remove sub AMD definitions, " +
104+ "(include/exclude modules with +/- flags), embed date/version" ,
102105 function ( ) {
103106 var flag , index ,
104107 done = this . async ( ) ,
@@ -113,15 +116,18 @@ module.exports = function( grunt ) {
113116 /**
114117 * Recursively calls the excluder to remove on all modules in the list
115118 * @param {Array } list
116- * @param {String } [prepend] Prepend this to the module name. Indicates we're walking a directory
119+ * @param {String } [prepend] Prepend this to the module name.
120+ * Indicates we're walking a directory
117121 */
118122 excludeList = function ( list , prepend ) {
119123 if ( list ) {
120124 prepend = prepend ? prepend + "/" : "" ;
121125 list . forEach ( function ( module ) {
122126 // Exclude var modules as well
123127 if ( module === "var" ) {
124- excludeList ( fs . readdirSync ( srcFolder + prepend + module ) , prepend + module ) ;
128+ excludeList (
129+ fs . readdirSync ( srcFolder + prepend + module ) , prepend + module
130+ ) ;
125131 return ;
126132 }
127133 if ( prepend ) {
@@ -143,7 +149,9 @@ module.exports = function( grunt ) {
143149 } ,
144150 /**
145151 * Adds the specified module to the excluded or included list, depending on the flag
146- * @param {String } flag A module path relative to the src directory starting with + or - to indicate whether it should included or excluded
152+ * @param {String } flag A module path relative to
153+ * the src directory starting with + or - to indicate
154+ * whether it should included or excluded
147155 */
148156 excluder = function ( flag ) {
149157 var m = / ^ ( \+ | \- | ) ( [ \w \/ - ] + ) $ / . exec ( flag ) ,
@@ -162,7 +170,7 @@ module.exports = function( grunt ) {
162170 // It's fine if the directory is not there
163171 try {
164172 excludeList ( fs . readdirSync ( srcFolder + module ) , module ) ;
165- } catch ( e ) {
173+ } catch ( e ) {
166174 grunt . verbose . writeln ( e ) ;
167175 }
168176 }
@@ -192,8 +200,10 @@ module.exports = function( grunt ) {
192200 // * none (implicit exclude)
193201 // *:* all (implicit include)
194202 // *:*:-css all except css and dependents (explicit > implicit)
195- // *:*:-css:+effects same (excludes effects because explicit include is trumped by explicit exclude of dependency)
196- // *:+effects none except effects and its dependencies (explicit include trumps implicit exclude of dependency)
203+ // *:*:-css:+effects same (excludes effects because explicit include is
204+ // trumped by explicit exclude of dependency)
205+ // *:+effects none except effects and its dependencies
206+ // (explicit include trumps implicit exclude of dependency)
197207 delete flags [ "*" ] ;
198208 for ( flag in flags ) {
199209 excluder ( flag ) ;
@@ -239,7 +249,9 @@ module.exports = function( grunt ) {
239249 // Turn off opt-in if necessary
240250 if ( ! optIn ) {
241251 // Overwrite the default inclusions with the explicit ones provided
242- config . rawText . jquery = "define([" + ( included . length ? included . join ( "," ) : "" ) + "]);" ;
252+ config . rawText . jquery = "define([" +
253+ ( included . length ? included . join ( "," ) : "" ) +
254+ "]);" ;
243255 }
244256
245257 // Trace dependencies and concatenate files
0 commit comments