Skip to content

Conversation

@sapphi-red
Copy link
Member

Description

fixes #19778
refs #16087

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release feat: build labels Apr 3, 2025
Comment on lines +238 to +251
if (!importedFiles) {
importedFiles = new Set()
for (const file in bundle) {
const chunk = bundle[file]
if (chunk.type === 'chunk') {
for (const importedFile of chunk.imports) {
importedFiles.add(importedFile)
}
for (const importedFile of chunk.dynamicImports) {
importedFiles.add(importedFile)
}
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking every time like #19775 does, this code constructs the Set if this look up happens. This is because I think that this look up either doesn't happen at all or it happens many times.

@patak-dev patak-dev merged commit 2fa1495 into vitejs:main Apr 3, 2025
18 checks passed
@sapphi-red sapphi-red deleted the fix/keep-entry-asset-files-imported-by-other-files branch April 3, 2025 09:19
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: build p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build attempts to import missing chunk when configured with rollupOptions.input

3 participants