Skip to content

Commit

Permalink
fix: ast parser should skip node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterAlfredLee committed Jul 1, 2021
1 parent 8b886d0 commit 3852d3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ast-parse/astParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const extensions = ['.vue']
export function astParseRoot (rootDir: string) {
const resolvedPaths : string[] = globby.sync(rootDir)
resolvedPaths.forEach(filePath => {
// skip files in node_modules
if (filePath.indexOf('/node_modules/') >= 0) {
return
}

const extension = (/\.([^.]*)$/.exec(filePath) || [])[0]
if (!extensions.includes(extension)) {
return
Expand Down

0 comments on commit 3852d3f

Please sign in to comment.