1

can we define Grunt subtask inside another subtask? I tried as follows and its not work.

 copy: {
       general : {
            fonts : {
                src: ['<%=src.font %>'],
                dest: '<%= distdir %>/assets/fonts',
                expand: true,
                flatten: true,
                filter: 'isFile'
            }
        }
}

Thanks.

1 Answers1

1

No, you can't. The structure is rigid, because it will reflect the way you'll call it : grunt task:target.

See http://gruntjs.com/configuring-tasks#task-configuration-and-targets

If you want to group multiple targets under the same call, you can use aliases, like

grunt.registerTask('copy-general', ['copy:font', 'copy:css']);

See http://gruntjs.com/creating-tasks#alias-tasks

krampstudio
  • 3,519
  • 2
  • 43
  • 63