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 }
@@ -171,7 +179,9 @@ module.exports = function( grunt ) {
171179 } else {
172180 grunt . log . error ( "Module \"" + module + "\" is a mimimum requirement." ) ;
173181 if ( module === "selector" ) {
174- grunt . log . error ( "If you meant to replace Sizzle, use -sizzle instead." ) ;
182+ grunt . log . error (
183+ "If you meant to replace Sizzle, use -sizzle instead."
184+ ) ;
175185 }
176186 }
177187 } else {
@@ -195,8 +205,10 @@ module.exports = function( grunt ) {
195205 // * none (implicit exclude)
196206 // *:* all (implicit include)
197207 // *:*:-css all except css and dependents (explicit > implicit)
198- // *:*:-css:+effects same (excludes effects because explicit include is trumped by explicit exclude of dependency)
199- // *:+effects none except effects and its dependencies (explicit include trumps implicit exclude of dependency)
208+ // *:*:-css:+effects same (excludes effects because explicit include is
209+ // trumped by explicit exclude of dependency)
210+ // *:+effects none except effects and its dependencies
211+ // (explicit include trumps implicit exclude of dependency)
200212 delete flags [ "*" ] ;
201213 for ( flag in flags ) {
202214 excluder ( flag ) ;
@@ -249,7 +261,9 @@ module.exports = function( grunt ) {
249261 // Turn off opt-in if necessary
250262 if ( ! optIn ) {
251263 // Overwrite the default inclusions with the explicit ones provided
252- config . rawText . jquery = "define([" + ( included . length ? included . join ( "," ) : "" ) + "]);" ;
264+ config . rawText . jquery = "define([" +
265+ ( included . length ? included . join ( "," ) : "" ) +
266+ "]);" ;
253267 }
254268
255269 // Trace dependencies and concatenate files
0 commit comments