Navigation Menu

Skip to content

Commit

Permalink
fix(scan): ignore virtual entries during scan
Browse files Browse the repository at this point in the history
close #2047
  • Loading branch information
yyx990803 committed Feb 16, 2021
1 parent ad50060 commit 6dc2d56
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -56,9 +56,12 @@ export async function scanImports(
entries = await globEntries('**/*.html', config)
}

// Non-supported entry file types should not be scanned for dependencies.
// Non-supported entry file types and virtual files should not be scanned for
// dependencies.
entries = entries.filter(
(entry) => JS_TYPES_RE.test(entry) || htmlTypesRE.test(entry)
(entry) =>
(JS_TYPES_RE.test(entry) || htmlTypesRE.test(entry)) &&
fs.existsSync(entry)
)

if (!entries.length) {
Expand Down

0 comments on commit 6dc2d56

Please sign in to comment.