Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created March 4, 2014 16:20
Show Gist options
  • Save cowboy/9349640 to your computer and use it in GitHub Desktop.
Save cowboy/9349640 to your computer and use it in GitHub Desktop.
Grunt: async config using a wrapper task
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