fix: 文件复制,目标文件夹不存在

This commit is contained in:
aringlai 2021-04-02 11:35:27 +08:00
parent e3bf8fdb0f
commit 80cc0dd491
2 changed files with 4 additions and 0 deletions

View File

@ -52,6 +52,7 @@
"deepmerge": "^4.2.2",
"envinfo": "^7.7.3",
"file-loader": "^6.2.0",
"fs-extra": "^9.1.0",
"html-webpack-plugin": "^5.0.0",
"html-webpack-tags-plugin": "^3.0.0",
"less": "3.9.0",

View File

@ -76,6 +76,9 @@ export default function (api) {
files.forEach((file) => {
const source = join(path, file);
const target = join(base, file);
if (!existsSync(base)) {
api.utils.mkdirp.sync(base);
}
if (statSync(source).isDirectory()) {
api.utils.mkdirp.sync(target);
} else if (Array.isArray(ignore)) {