【问题标题】:Copy one file to multiple folders with grunt使用 grunt 将一个文件复制到多个文件夹
【发布时间】:2015-09-22 21:19:05
【问题描述】:

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

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

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

谢谢!

【问题讨论】:

    标签: gruntjs grunt-contrib-copy


    【解决方案1】:

    * 不可能,您必须使用 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' },
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 1970-01-01
      • 2013-10-29
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 2014-12-02
      相关资源
      最近更新 更多