diff --git a/packages/vant-cli/src/compiler/gen-style-deps-map.ts b/packages/vant-cli/src/compiler/gen-style-deps-map.ts index 69d796fd5..1b46d8d51 100644 --- a/packages/vant-cli/src/compiler/gen-style-deps-map.ts +++ b/packages/vant-cli/src/compiler/gen-style-deps-map.ts @@ -32,10 +32,14 @@ function compileTempDir(dir: string): Promise { const filePath = join(dir, filename); if (isDir(filePath)) { + if (filePath.includes('/test') || filePath.includes('/demo')) { + return Promise.resolve(); + } + return compileTempDir(filePath); } - if (filename.indexOf('index') !== -1) { + if (filename.includes('index')) { if (isSfc(filePath)) { return compileSfc(filePath, { skipStyle: true }); }