0
{
expand: true,
cwd: '/static',
src: ['**'],
dest: '../../public/'
}
我试图将静态文件夹及其所有内容复制到公用文件夹,但上面只复制了静态文件夹内的内容。使用cwd复制文件夹
我该如何在副本中包含静态文件夹?
{
expand: true,
cwd: '/static',
src: ['**'],
dest: '../../public/'
}
我试图将静态文件夹及其所有内容复制到公用文件夹,但上面只复制了静态文件夹内的内容。使用cwd复制文件夹
我该如何在副本中包含静态文件夹?
cwd: All src matches are relative to (but don't include) this path.
下面从咕噜-contrib请复制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/'},
感谢 - 这是什么过滤器: 'ISFILE' 呢? – panthro
filter属性允许您更精确地定位您想要复制的内容。您可以使用[此处]列出的任何方法(https://nodejs.org/docs/latest/api/fs.html#fs_class_fs_stats)。在你的情况下,你可能不想使用过滤器,因为你可能也想要目录。 – chrxr
@panthro,如果这对你有用,你能标记为正确吗?谢谢。 – chrxr