Skip to content

Commit

Permalink
fix: avoid preloading owner chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 18, 2021
1 parent 7a45427 commit 61969d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/importAnaysisBuild.ts
Expand Up @@ -210,8 +210,10 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
const deps: Set<string> = new Set()

if (url[0] === `"` && url[url.length - 1] === `"`) {
const ownerFilename = chunk.fileName
// literal import - trace direct imports and add to deps
const addDeps = (filename: string) => {
if (filename === ownerFilename) return
const chunk = bundle[filename] as OutputChunk | undefined
if (chunk) {
deps.add(config.build.base + chunk.fileName)
Expand Down

0 comments on commit 61969d7

Please sign in to comment.