1

我需要将文件夹 src/plugin@xxx 中的文件复制到 dist/plugin。

版本可以更改,所以我想在任何地方省略版本号。我愿意:

files[{
    cwd: 'src'
    src: 'plugin@*/**/*'
    dest: 'dist/plugin'
}];

但它将我的文件复制到 dist/plugin/plugin@xxx 目录。

我希望我的文件在 dist/plugin 目录中(在 grunt 任务中没有指定 xxx)。

4

1 回答 1

0

你想要这个flatten选项。我认为您还需要expand工作flatten

files: [ {
    cwd: 'src'
    src: 'plugin@*/**/*'
    dest: 'dist/plugin',
    expand: true,
    flatten: true
} ],
于 2015-11-22T21:11:01.343 回答