0

I'm using the following method to optimize multiple modules (optimizing multiple) and everything works fine when I am not using the multitask configuration.

This works:

'requirejs': require('./build_config/requirejs.js')(grunt, config)

This doesn't:

'requirejs': {
'task1': require('./build_config/requirejs.js')(grunt, config)

}

where requirejs.js is as follows: The gist

Rob Allen
  • 2,871
  • 2
  • 30
  • 48

1 Answers1

1

based off the "options['task' + x]" reference it looks like you're putting your tasks inside the task1 task def which doesn't work. if you want to run all your requirejs tasks then you can just run "grunt requirejs". if you want to combine static and dynamically defined config then you could...

var requirejsTasks = { ... }
_.extend( requirejsTasks, require('./build_config/requirejs.js')(grunt, config) );
Matthew Kime
  • 754
  • 1
  • 6
  • 15
  • ah, I think you changed my perspective. Gonna give this a shot. – Rob Allen Mar 11 '15 at 20:09
  • I didn't exactly do it this way. I ended up modifying the object inside of the ./build_config/requirejs.js which is basically the same idea. The key here was making me realize that I was nesting tasks at the wrong level basically. – Rob Allen Mar 12 '15 at 21:14