Configure grunt copy task to exclude files/folders

后端 未结 5 1345
甜味超标
甜味超标 2020-12-01 09:04

I have installed the grunt task grunt-contrib-copy. I embedd it in my Gruntfile.js and load the task via grunt.loadNpmTasks(\'grunt-contrib-c

5条回答
  •  盖世英雄少女心
    2020-12-01 09:53

    Assuming that 'Gruntfile.js' is in root directory, the last line in your copy options is configuring it to copy everything in root to 'output/'.

    If this is intended, add '!Gruntfile.js' to your array of src file paths.

    {
      expand: true, 
      cwd: './', 
      src: ['**'],      // ex. src: ['**',  '!Gruntfile.js'],
      dest: 'output/'
    }
    

    Refer to these solutions from this thread and original thread

提交回复
热议问题