Allow for mainDirs, viewDirs, and modelDirs to be specified.
Showing
1 changed file
with
16 additions
and
16 deletions
... | @@ -240,7 +240,7 @@ module.exports = function (grunt) { | ... | @@ -240,7 +240,7 @@ module.exports = function (grunt) { |
240 | 240 | ||
241 | function jscheckerAddExtra(src, container, dest) { | 241 | function jscheckerAddExtra(src, container, dest) { |
242 | if (src) { | 242 | if (src) { |
243 | container[dest] = container[dest].concat(src); | 243 | container[dest] = (container[dest] || []).concat(src); |
244 | } | 244 | } |
245 | } | 245 | } |
246 | function createJschecker(name, browserOptions, modelOptions, viewOptions) { | 246 | function createJschecker(name, browserOptions, modelOptions, viewOptions) { |
... | @@ -254,27 +254,27 @@ module.exports = function (grunt) { | ... | @@ -254,27 +254,27 @@ module.exports = function (grunt) { |
254 | ], | 254 | ], |
255 | main: { | 255 | main: { |
256 | options: _.extend({}, mpConfig[name].browserOptions, browserOptions), | 256 | options: _.extend({}, mpConfig[name].browserOptions, browserOptions), |
257 | files: { | 257 | files: _.map(_.concat([], mpConfig.mainDirs), function (value) { |
258 | src: [ | 258 | return { |
259 | mpConfig.base + '/scripts/*.js', | 259 | src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js', |
260 | ], | 260 | }; |
261 | }, | 261 | }), |
262 | }, | 262 | }, |
263 | model: { | 263 | model: { |
264 | options: _.extend({}, mpConfig[name].modelOptions, modelOptions, mpConfig[name].browserOptions, browserOptions), | 264 | options: _.extend({}, mpConfig[name].modelOptions, modelOptions, mpConfig[name].browserOptions, browserOptions), |
265 | files: { | 265 | files: _.map(_.concat([mpConfig.modelDir], mpConfig.modelDirs), function (value) { |
266 | src: [ | 266 | return { |
267 | mpConfig.base + '/scripts/' + mpConfig.modelDir + '/**/*.js', | 267 | src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js', |
268 | ], | 268 | }; |
269 | }, | 269 | }), |
270 | }, | 270 | }, |
271 | view: { | 271 | view: { |
272 | options: _.extend({}, mpConfig[name].viewOptions, viewOptions, mpConfig[name].browserOptions, browserOptions), | 272 | options: _.extend({}, mpConfig[name].viewOptions, viewOptions, mpConfig[name].browserOptions, browserOptions), |
273 | files: { | 273 | files: _.map(_.concat([mpConfig.viewDir], mpConfig.viewDirs), function (value) { |
274 | src: [ | 274 | return { |
275 | mpConfig.base + '/scripts/' + mpConfig.viewDir + '/**/*.js', | 275 | src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js', |
276 | ], | 276 | }; |
277 | }, | 277 | }), |
278 | }, | 278 | }, |
279 | }; | 279 | }; |
280 | jscheckerAddExtra(mpConfig[name].all, initConfig[name], 'all'); | 280 | jscheckerAddExtra(mpConfig[name].all, initConfig[name], 'all'); | ... | ... |
-
Please register or sign in to post a comment