mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): ignore import types when analyzing deps (#8574)
This commit is contained in:
parent
84b45c4840
commit
33bdcbc029
@ -9,7 +9,8 @@ let existsCache: Record<string, boolean> = {};
|
|||||||
const IMPORT_RE = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
|
const IMPORT_RE = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
|
||||||
|
|
||||||
function matchImports(code: string): string[] {
|
function matchImports(code: string): string[] {
|
||||||
return code.match(IMPORT_RE) || [];
|
const imports = code.match(IMPORT_RE) || [];
|
||||||
|
return imports.filter((line) => !line.includes('import type'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function exists(filePath: string) {
|
function exists(filePath: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user