Javascript grunt copy不从my'重新发送文件;发展';将文件夹放入';生产';,当我修改文件时

Javascript grunt copy不从my'重新发送文件;发展';将文件夹放入';生产';,当我修改文件时,javascript,gruntjs,grunt-contrib-watch,grunt-contrib-copy,Javascript,Gruntjs,Grunt Contrib Watch,Grunt Contrib Copy,当我在开发文件上单击save anywhere时,它似乎没有重新复制我的文件(因此我想立即重新复制到生产文件夹)。这是我的Grunfile.js中的部分 此文件的位置:/development/grunfile.js 我想在哪里复制一些文件:/production [...] copy: { watch: { options: { livereload: true }, files: [ {expand: true, src: ['css/*

当我在开发文件上单击save anywhere时,它似乎没有重新复制我的文件(因此我想立即重新复制到生产文件夹)。这是我的Grunfile.js中的部分

此文件的位置:/development/grunfile.js

我想在哪里复制一些文件:/production

[...]

copy: {
  watch: {
    options: {
      livereload: true
    },
    files: [
      {expand: true, src: ['css/*'], dest: '../production/', filter: 'isFile'},
      {expand: true, src: ['js/*'], dest: '../production/', filter: 'isFile'},
      {expand: true, src: ['js/vendor/*'], dest: '../production/', filter: 'isFile'},

      {expand: true, src: ['images/**'], dest: '../production/'},
      {expand: true, src: ['public/**'], dest: '../production/'},

      {expand: true, src: ['.htaccess', '404.html', 'apple-touch-icon-precomposed.png', 'crossdomain.xml', 'favicon.ico', 'humans.txt', 'index.html', 'index.php', 'LICENSE.md', 'README.md', 'robots.txt'], dest: '../production/'}
    ]
  }
},

php: {
  watch: {
    options: {
      livereload: true,
      bin: 'C:/php/php.exe',
      ini: 'C:/php/php.ini',
      base: '../production',
      port: 8000
    }
  }
},

watch: {
  options: {
    livereload: true
  },
  site: {
    files: ['*.html', '*.php', 'public/*.html', 'public/*.php'],
    tasks: ['php'],
    options: {
      spawn: false
    }
  }
}

[...]

grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-php');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['uglify', 'replace', 'stylus', 'cssmin', 'copy:watch', 'php:watch', 'watch']);
我总是需要重新启动脚本,将文件重新发送到“生产”文件夹

谢谢你的帮助

更新

我做了一个改变的解决方案:所有发生在开发文件夹中的事情,如果我愿意,我可以使用命令行推送到生产文件夹。这样,我就可以在开发文件夹中的本地PHP Web服务器中看到最终产品,而不是产品

grunt.registerTask('default', ['uglify', 'replace', 'stylus', 'cssmin', 'php:watch', 'watch']);
grunt.registerTask('copytoproduction', ['copy']);