diff --git a/build-tools/handleApiFiles.js b/build-tools/handleApiFiles.js index 677a681c82f0c00425ef93151e6a37d717bd2d2d..89956f2d8ba8ce7be883e9461b5c835a9ea3f1d2 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)) {