__vite__mapDeps optimization breaks configuration depending on Vite bundling #17575
Closed
7 tasks done
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
regression
The issue only appears after a new release
Describe the bug
#16184 caused a regression in our codebase when upgrading to 5.3.x. We use the
renderBuiltUrl
to update the asset URL based on some configuration.Vite config:
window.__toStaticUrl
is depending on some configuration and is loaded in a file we callpreload.ts
before our main fileentry.ts
. Snippet from our index.html file:In prouduction vite bundles preload and entry into one chunk. This used to work fine, but the challenge with the change in this PR is that instead of lazy evaluating
window.__toStaticUrl
when building the mapDeps, we now expect the function to be defined beforehand. As the function is not defined we get aTypeError: window.__toStaticUrl is not a function
.Additional context in #16184 (comment)
Reproduction
#16184 (comment)
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: