【发布时间】:2016-04-07 21:17:17
【问题描述】:
{
expand: true,
cwd: '/static',
src: ['**'],
dest: '../../public/'
}
我正在尝试将静态文件夹及其所有内容复制到公用文件夹,但以上仅复制静态文件夹内的内容。
如何在副本中也包含静态文件夹?
【问题讨论】:
标签: javascript gruntjs grunt-contrib-copy
{
expand: true,
cwd: '/static',
src: ['**'],
dest: '../../public/'
}
我正在尝试将静态文件夹及其所有内容复制到公用文件夹,但以上仅复制静态文件夹内的内容。
如何在副本中也包含静态文件夹?
【问题讨论】:
标签: javascript gruntjs grunt-contrib-copy
来自Grunt docs:
cwd: All src matches are relative to (but don't include) this path.
以下来自 grunt-contrib-copy readme:
// 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/'},
【讨论】: