Repository navigation
fix(build): read chunk import map from environment (fix #23119) - #23120
Closed
rushijagani-dev wants to merge 1 commit into
Closed
rushijagani-dev wants to merge 1 commit into
rushijagani-dev wants to merge 1 commit into
Conversation
|
Reporter here — verified against the repro linked in #23119. I built vite from this branch and from its merge-base (
|
Author
|
Thanks for verifying this against the repro matrix and for checking both the merge-base and this branch. Glad to hear both the environment-scoped import map case and the root-scope opt-out crash are fixed here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #23119
This makes the chunk import map build hooks read
build.chunkImportMapfrom the active environment config instead of the root config captured when shared plugin instances are used. Withbuilder.sharedPlugins, an environment-levelbuild.chunkImportMap: truenow letsvite:build-import-analysisread the generated import map and produce preload dependency lists for dynamic chunks and their CSS. The CSS post-processing and HTML import-map injection paths also use the environment config and skip missing import-map assets, so an environment that opts out does not crash when another config scope enables the option. Regression coverage exercises both the shared-plugin environment enablement path and the environment opt-out path.Validation:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pnpm installpassedpnpm exec vitest run packages/vite/src/node/__tests__/build.spec.ts -t 'chunk import map|chunkImportMap'passed under Node v24.4.1pnpm run buildpassed under Node v24.4.1pnpm run lintpassed under Node v24.4.1pnpm run typecheckpassed under Node v24.4.1git diff --checkpassedBlockers:
pnpm installwithoutPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1could not complete locally because theplaywright-chromiumbrowser download failed withUNABLE_TO_GET_ISSUER_CERT_LOCALLY. I did not run the full browser-backedpnpm testsuite locally for that reason.