registerTask after renameTask does not recognize the new task name
I want to run grunt-autoprefixer after LESS. One would expect that the following code achieves this goal:
// Gruntfile.js
module.exports = function(grunt) {
grunt.config({ less: { ... }, autoprefixer: { ... } });
grunt.loadNpmTasks('assemble-less');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.renameTask('less', 'less-only');
grunt.registerTask('less', ['less-only', 'autoprefixer']);
grunt.registerTask('default', ['less']);
};
However, it doesn't.. This is the verbose log:
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Registering "assemble-less" local Npm module tasks.
Reading /tmp/demo/node_modules/assemble-less/package.json...OK
Parsing /tmp/demo/node_modules/assemble-less/package.json...OK
Loading "less.js" tasks...OK
+ less
Registering "grunt-autoprefixer" local Npm module tasks.
Reading /tmp/node/node_modules/grunt-autoprefixer/package.json...OK
Parsing /tmp/node/node_modules/grunt-autoprefixer/package.json...OK
Loading "autoprefixer.js" tasks...OK
+ autoprefixer
Loading "Gruntfile.js" tasks...OK
- less
+ default, less, less-only
No tasks specified, running default tasks.
Running tasks: default
Running "default" task
Running "less" task
Running "less-only" task
>> No "less-only" targets found.
Warning: Task "less-only" failed. Use --force to continue.
Aborted due to warnings.