0
{ 
    expand: true,
    cwd: '/static',
    src: ['**'],
    dest: '../../public/'
}

我正在尝试将静态文件夹及其所有内容复制到公用文件夹,但上面仅复制静态文件夹内的内容。

我怎样才能在副本中包含静态文件夹?

4

1 回答 1

0

来自Grunt 文档

 cwd: All src matches are relative to (but don't include) this path.

以下来自 grunt-contrib-copy自述文件:

  // includes files within path
  {expand: true, src: ['path/*'], dest: 'dest/', filter: 'isFile'},

  // includes files within path and its sub-directories
  {expand: true, src: ['path/**'], dest: 'dest/'},
于 2016-04-07T13:17:17.517 回答