我正在尝试复制这样的结构:
src
|-a
|-b
|-c
||-ca
||-cb
dest
|-a
|-b
|-c
||-ca
||-cb
但是,如果没有 src 目录本身出现在 dest 目录中,我似乎无法完成此操作。IE
src
|-a
|-b
|-c
||-ca
||-cb
dest
|src
||-a
||-b
||-c
|||-ca
|||-cb
我的副本配置设置如下:
files: [
{src: [targetDirectory+"index.html"], dest: buildDirectory, expand: true},
{src: [targetDirectory+"*.png"], dest: buildDirectory, expand: true},
{src: [targetDirectory+minJSDestination], dest: buildDirectory, expand: true},
{src: [targetDirectory+minCSSDestination], dest: buildDirectory, expand: true},
{src: [targetDirectory+"assets/fonts/**.*"], dest: buildDirectory, expand: true},
{src: [targetDirectory+"assets/images/**.*"], dest: buildDirectory, expand: true},
{src: [targetDirectory+"assets/partials/**.*"], dest: buildDirectory, expand: true},
{src: [targetDirectory+"src/*.js"], dest: buildDirectory, expand: true}
]
我已经尝试过从 dest 中删除“src”目录的 flatten 选项,但它也删除了其他目录并将每个文件放在 dest 的根级别。
我尝试将“cwd”设置为目标目录和源目录,但这似乎只是阻止了复制。
我确信必须有一个允许这样做的选项,但我还没有找到它。有人有想法么?