docs: document server.preTransformRequests - #23230
Open
wahidrizka wants to merge 1 commit into
Open
Conversation
The option is part of the public ServerOptions type and carries a @default, but it was never mentioned anywhere in the docs, so the only way to find it was reading the source. Placed next to server.warmup since both control the same pre-transform behaviour.
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.
What
server.preTransformRequestsis part of the publicServerOptionstype and carries its own JSDoc and@default, butgrep -rn "preTransformRequests" docs/returns nothing. The only way to discover it today is readingpackages/vite/src/node/server/index.ts.It is also the odd one out next to
server.warmup, which sits in the same interface, controls closely related behaviour, and is documented.Changes
Adds a
## server.preTransformRequestssection todocs/config/server-options.md, placed betweenserver.warmupandserver.watch. It covers:ServerOptions.preTransformRequestsimportAnalysiscallsenvironment.warmupRequest()for every static local import of a module it transforms, so those modules are ready before the browser asks for themserver.open's early-crawl optimisation depends on it (server/index.tsguards that path withif (server.config.server.preTransformRequests))What I checked
The one internal link I used,
#server-open, already resolves:## server.openexists in the same file anddocs/config/preview-options.mdlinks to it the same way. The code sample matches the formatting of theserver.warmupsample directly above it.I did not run
pnpm run test-docslocally, since it needs a full monorepo install and build to be meaningful. The change is markdown only, with no new anchors and no new external links.