Repository navigation
Conversation
resolve-vite-config.ts imported withConfigMetadataResolution from define-config.ts, which imports Vite and vitest/config at the top level. Thus `vp create` loaded Vite at startup, also when it only looked up config files. resolveViteConfig already loads Vite with a dynamic import. Move withConfigMetadataResolution and its counter into config-metadata.ts, which does not import Vite. define-config.ts re-exports it, so its callers do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fengmk2
marked this pull request as ready for review
November 25, 2026 16:14
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://perf-create-skip-eager-vite-viteplus-dev.voidzero-docs.workers.dev (commit 79bcd87)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
cpojer
approved these changes
Nov 25, 2026
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.
vp createloaded Vite andvitest/configat startup, also on paths that read no config. This PR moves one small function so that Vite loads only whenvp createreads a config.Why
vp createloaded ViteNode.js loads and evaluates every static
importof an entry, and the imports of those modules, before the entry runs its first line. In the built CLI,viteis an external package. Thus a chunk that uses Vite starts withimport ... from "vite", and each chunk that imports that chunk loads Vite first.vp createreached Vite through this static chain:From
define-config.ts,resolve-vite-config.tsused onlywithConfigMetadataResolution. This function only sets and restores an environment variable. But an import cannot take one function without loading its module. Tree shaking does not remove theviteimport either:define-config.tsis also an entry (index,define-config), so its code stays in one shared chunk.The change
withConfigMetadataResolutionand its counter move intoconfig-metadata.ts, which imports onlyutils/constants.ts:define-config.tsre-exports the function, so its callers do not change.define-configandresolve-vite-configstill share one counter.Vite now loads only in
resolveViteConfig, through its existingawait import('./index.js').vp createcalls this function only when the monorepo root, or the start directory outside a monorepo, has avite.config.*file. It then reads thecreateblock.Startup
Startup is the time from process start until
vp createparses its arguments. The values use a warm compile cache.vp createstartupvp createstartupcreate/bin.jscreate/bin.jsThe change affects only the startup. The rest of
vp create(prompts, file writes, install) does not change.Behavior changes
vp createloads Vite only when it reads thecreateblock of a config, for example in a monorepo with a rootvite.config.ts. It then loads Vite later than before.vp stagedandvp packload Vite when they resolve the config, not when the command starts. Each normal run still loads Vite.🤖 Generated with Claude Code