使用grun将一个文件复制到多个文件夹

Copy one file to multiple folders with grunt

是否可以使用Grunt 将一个文件复制到多个目录? 即:

expand: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.app %>/client/*',
src: 'core/index.html'

其中 * 是客户文件夹中的所有子文件夹。

谢谢!

* 无法实现,您必须使用 files 选项映射任何文件夹。在这种情况下,您不需要 expand 选项:

files: [
  { src: 'core/index.html' dest: '<%= yeoman.app %>/folder1' },
  { src: 'core/index.html: '<%= yeoman.app %>/folder2' },
  { src: 'core/index.html' <%= yeoman.app %>: 'dest/folder3' },
]