diff --git a/src/plugin/.gitkeep b/src/plugin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vitePlugin/componentName/index.js b/vitePlugin/componentName/index.js index bae9f0f..8f87c68 100644 --- a/vitePlugin/componentName/index.js +++ b/vitePlugin/componentName/index.js @@ -12,6 +12,9 @@ const clearAndUpper = (text) => { // 递归获取目录下所有的 .vue 文件 const getAllVueFiles = (dir, fileList = []) => { + if (!fs.existsSync(dir)) { + return fileList + } const files = fs.readdirSync(dir) files.forEach((file) => { const filePath = path.join(dir, file)