Created
March 4, 2014 16:20
-
-
Save cowboy/9349640 to your computer and use it in GitHub Desktop.
Grunt: async config using a wrapper task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({}); | |
grunt.registerTask('require-wrapper', 'whatever', function() { | |
var done = this.async(); | |
var args = this.args; | |
// simulate async config building | |
setTimeout(function() { | |
// set config | |
grunt.config('requirejs', {yay: true}); | |
// run "requirejs" task passing through all args after this task | |
task.run('requirejs' + (args.length > 0 ? (':' + args.join(':')) : '')); | |
// run next task | |
done(); | |
}, 1000); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment