diff --git a/build-tools/handleApiFiles.js b/build-tools/handleApiFiles.js index d12bbacff8753c2adba2d188ada21c0fcf5acc89..e86bd535209afceec2a5a5df139d6af5836bd747 100755 --- a/build-tools/handleApiFiles.js +++ b/build-tools/handleApiFiles.js @@ -112,7 +112,8 @@ function handleApiFiles(rootPath, type, output) { console.log('error===>', error); } } - if (type === DirType.typeTwo) { + const hasApiDir = fs.existsSync(path.join(output, 'api')); + if (type === DirType.typeTwo && hasApiDir) { NotNullFilePath.forEach((dir) => { const outDir = path.join(output, dir); if (!fs.existsSync(outDir)) {