Skip to content

Commit

Permalink
perf: ignore node_modules when globbing import.meta.glob
Browse files Browse the repository at this point in the history
close #1974
  • Loading branch information
yyx990803 committed Feb 11, 2021
1 parent 446b815 commit 8b3d0ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vite/src/node/importGlob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export async function transformImportGlob(
pattern = pattern.slice(2)
}
}
const files = glob.sync(pattern, { cwd: base })
const files = glob.sync(pattern, {
cwd: base,
ignore: ['**/node_modules/**']
})
const imports: string[] = []
let importsString = ``
let entries = ``
Expand Down

0 comments on commit 8b3d0ea

Please sign in to comment.