Skip to content

Commit

Permalink
fix(scan): only scan supported entry file types
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 8, 2021
1 parent f11bf11 commit a93e61d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
import { init, parse } from 'es-module-lexer'
import MagicString from 'magic-string'
import { transformImportGlob } from '../importGlob'
import { isCSSRequest } from '../plugins/css'
import { ensureService } from '../plugins/esbuild'

const debug = createDebugger('vite:deps')
Expand Down Expand Up @@ -57,9 +56,9 @@ export async function scanImports(
entries = await globEntries('**/*.html', config)
}

// CSS/Asset entrypoints should not be scanned for dependencies.
// Non-supported entry file types should not be scanned for dependencies.
entries = entries.filter(
(entry) => !(isCSSRequest(entry) || config.assetsInclude(entry))
(entry) => JS_TYPES_RE.test(entry) || htmlTypesRE.test(entry)
)

if (!entries.length) {
Expand Down

0 comments on commit a93e61d

Please sign in to comment.