Skip to content

fix(build): use resolved base for chunk import map keys - #23351

Closed
lazerg wants to merge 1 commit into
vitejs:mainfrom
lazerg:fix/issue-23350-import-map-base-url
Closed

fix(build): use resolved base for chunk import map keys#23351
lazerg wants to merge 1 commit into
vitejs:mainfrom
lazerg:fix/issue-23350-import-map-base-url

Conversation

@lazerg

@lazerg lazerg commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

When build.chunkImportMap is enabled, the baseUrl handed to rolldown is always the resolved base, overwriting anything set in rolldownOptions.experimental.chunkImportMap.baseUrl. getImportMapBaseUrl still read that user value back instead, which is either unset or already overwritten, so it fell back to / whenever base wasn't /. That mismatch made the import map keys and the mapping lookup diverge, dropping __vite__mapDeps and modulepreload/CSS references for lazy chunks.

getImportMapBaseUrl is only ever reached behind that same chunkImportMap flag, so it can just return the resolved base directly.

fixes #23350

@github-actions github-actions Bot added the bot: likely Likely a bot, LLM, or agent. Automatically comments and closes the issue or PR label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically flagged as likely to be created by a bot, LLM, or agent, and will be automatically closed. These contributions harm the maintenance of the project. Please read our AI policy for more information.

If you believe this is a mistake, please reply to this comment and we will review it.

@github-actions github-actions Bot closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: likely Likely a bot, LLM, or agent. Automatically comments and closes the issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build.chunkImportMap drops module preload dependency lists when base is not /

1 participant