Gruntfile.js is just simple JavaScript file so you can write any code you need:
var project_name = get_my_project_name();
grunt.registerTask(project_name + '-build','Builds my app.',['build']);
Question
I have a couple project that I would like to use the same template for.
This has caused me to want to prefix my grunt tasks which I register with a project abbreviation vs a script that has to generate these project specific grunt files.
Is this possible to do?
ex.
from -
grunt.registerTask('proj-build','Builds my app.',['build']);
to -
grunt.registerTask(<PROJECT NAME>'-build','Builds my app.',['build']);
Thanks!
Solution
Gruntfile.js is just simple JavaScript file so you can write any code you need:
var project_name = get_my_project_name();
grunt.registerTask(project_name + '-build','Builds my app.',['build']);