grunt requirejs multitask and multiple files

64 Views Asked by At

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

1

There are 1 best solutions below

2
On BEST ANSWER

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) );