0

我有一个包含文件的 gulp.src 流:

file.cwd         file.base                                         file.path
D:\Projects\test D:\Projects\test\public\app\                      D:\Projects\test\public\app\bootstrap-8843d1ff.js
D:\Projects\test D:\Projects\test\public\app\contacts\views\index\ D:\Projects\test\public\app\contacts\views\index\contacts-4173bf62.js
D:\Projects\test D:\Projects\test\public\app\homepage\views\index\ D:\Projects\test\public\app\homepage\views\index\homepage-1eb3581b.js
D:\Projects\test D:\Projects\test\public\app\user\resources\       D:\Projects\test\public\app\user\resources\user-f75d774a.js
D:\Projects\test D:\Projects\test\public\                          D:\Projects\test\public\index.html

我想将文件另存为:

gulp.dest('test\build') ->
test\build\app\bootstrap-8843d1ff.js
test\build\app\contacts-4173bf62.js
test\build\app\homepage-1eb3581b.js
test\build\app\user-f75d774a.js
test\build\index.html

如何重命名流中的 cwd、base 和 path,以便在需要时保存?

4

1 回答 1

0
file.cwd         file.base                file.path
D:\Projects\test D:\Projects\test\public\ D:\Projects\test\public\app\bootstrap-8843d1ff.js
D:\Projects\test D:\Projects\test\public\ D:\Projects\test\public\app\contacts-4173bf62.js
D:\Projects\test D:\Projects\test\public\ D:\Projects\test\public\app\homepage-1eb3581b.js
D:\Projects\test D:\Projects\test\public\ D:\Projects\test\public\app\user-f75d774a.js
D:\Projects\test D:\Projects\test\public\ D:\Projects\test\public\index.html
于 2015-01-27T15:37:05.943 回答