2017-03-03 79 views
1

我使用NPM包「copyfiles」在我buildscript。 但目標目錄不是我所期望的。NPM copyfiles不正確的目標路徑

"copy-template": "copyfiles \"./src/**/*.html\" \"dist\"", 

基本目錄結構是:

src/pages/.../htmlfiles 

我要的是:

dist/pages/.../htmlfiles 

所以相同的結構,以前沒有 「SRC」 在那一刻我有總是我的dist文件夾中的src目錄。

dist/src/pages/../htmlfiles 

也許你對我有一些提示?

最佳大衛

回答

2

更改您的腳本如下:

... 
"scripts": { 
    "copy-template": "copyfiles -u 1 \"./src/**/*.html\" \"dist\"", 
    ... 
}, 
... 

注意,添加--up-u選項作爲docs解釋。

+0

非常感謝! – fishme