So I mean something like:
grunt.registerTask('default', ['default']); // CLI: grunt
grunt.registerTask('serve', ['serve']); // CLI: grunt serve
grunt.registerTask('test', ['test']); // CLI: grunt test
And then I want just one task which runs the 3 of those in one call, like, if I type into the cmd "grunt tasks", it runs any tasks I want such as default, serve or test in the order I specify, etc.
Can this be done? The docs arent very clear (maybe its my dyspraxia, but it just doesnt read well to me).
Cheers,
-- SD
Yes, you can very easily.
From the documentation:
You can configure Grunt to run one or more tasks by default by defining a default task. In the following example, running grunt at the command line without specifying a task will run the uglify task. This is functionally the same as explicitly running grunt uglify or even grunt default. Any number of tasks (with or without arguments) may be specified in the array.
The key part of the excerpt above is bolded.
For example, create a task called runAllThree, and specify all three tasks you'd like to run inside of the array.
grunt.registerTask('runAllThree', ['default', 'serve', 'test']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With