Skip to content

Commit

Permalink
feat(get-deps): 对应正则的优化之前的太宽泛了
Browse files Browse the repository at this point in the history
  • Loading branch information
sunguohui committed Jul 11, 2023
1 parent 7ab80e5 commit 3446a1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vant-cli/src/compiler/get-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ let existsCache: Record<string, boolean> = {};
// https://regexr.com/47jlq
const IMPORT_RE =
/import\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
const IMPORT_NOF_RE =
/import\s*\(\s*?\S*?(\/\*)?\s*?\S*?.+?\s*?\S*?(\*\/)?['"].+?['"]\s*?\S*?\)/g;

const IMPORT_NOF_RE = /import\s*\(\s*?['"].+?['"]\)/g;

const EXPORT_FROM_RE =
/@?export\s+?(?:(?:(?:[\w*\s{},]*)\s+from(\s+)?)|)(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;

Expand Down

0 comments on commit 3446a1c

Please sign in to comment.