How can I load two grunt tasks with the same name?

前端 未结 1 892
心在旅途
心在旅途 2021-01-04 01:23

Im using yeoman for a project.

Basically it\'s working fine, but during the build process I want to move my images folder to somewhere else.

So I loaded the

相关标签:
1条回答
  • 2021-01-04 01:53

    grunt.renameTask() will probably help you here. Try this:

    // temporarily rename yeoman's copy task
    grunt.renameTask('copy', 'yeomanCopy');
    // load 'copy' from grunt-contrib-copy
    grunt.loadNpmTasks('grunt-contrib-copy');
    // rename it to something other than 'copy'
    grunt.renameTask('copy', 'myCopy');
    // rename yeoman's task back to its original name so nothing breaks
    grunt.renameTask('yeomanCopy', 'copy');
    
    // now use 'myCopy' for your purposes
    // ...
    
    0 讨论(0)
提交回复
热议问题