Repository navigation
Conversation
This branch has not been deployed
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.
defaults
dev.preTransformRequeststotruefor every environment, not just client. cold SSR loads in dev go ~2x faster.fixes #24093
why
ssr-transformed modules await their imports one by one, so with pre-transform off every module starts resolve/load/transform only after the previous one is done. turning it on lets importAnalysis warm up static imports while the runner is still busy upstream, same as on the client. Vite 5 did this for ssr already, it got lost in #16471 (#19272 noticed it too). details and history in the issue.
externalized imports return before the warmup call in importAnalysis, so nothing extra in node_modules gets transformed.
numbers
cold
runner.import()of a seeded react+ts app, on a default config, comparing upstreamf89888822vs this branch, 7 interleaved runs, mac M1 Pro, nodejs v26:repro on published 8.3.8 by flipping the option: https://github.com/hood/vite-ssr-pretransform-repro
RSS goes up a bit, more transforms in flight at once.
things worth a look
customenvironments flip totruetoo (snapshot updated). they load through the same module runner, so same win, but lmk if you'd rather keep it toconsumer === 'server'.Pre-transform error, same as the client env does today. opt out isserver.preTransformRequests: false.vitestmight want to set it explicitly.tests
pnpm test-unit,pnpm test-serve,pnpm test-buildon this branchPre-transform errorlogs.ssr-htmlalready asserts on thatpreTransformRequestsconfig test covers the defaultAI disclosure: helped myself w/ Claude Code for profiling and digging through git history.