From 501eb5dc9b8c506d0bce4e0c78aa3c5eb57bcce4 Mon Sep 17 00:00:00 2001 From: branchseer Date: Fri, 15 May 2026 09:36:49 +0800 Subject: [PATCH 01/15] feat: integrate with Vite Task for zero-config build caching When Vite runs under Vite Task (`vp run`), report build inputs, outputs, and tracked env vars to Vite Task so that caching of `vite build` works without manual input/output configuration: - `loadEnv`: ask Vite Task for every env matching each prefix, so the glob + match-set enter the build's cache fingerprint. - optimizer: mark the deps cache dir as neither input nor output (the lockfile hash already drives re-optimization). - `prepareOutDir`: ignore `outDir` as an input so `emptyDir`'s reads don't mix with the writes that follow. - `loadConfigFromBundledFile`: ignore `node_modules/.vite-temp` so the transient bundled-config file doesn't poison the cache. All calls go through `@voidzero-dev/vite-task-client`, which is a no-op when Vite is not running inside Vite Task. --- packages/vite/package.json | 1 + packages/vite/src/node/config.ts | 11 +++++++++++ packages/vite/src/node/env.ts | 12 ++++++++++++ packages/vite/src/node/optimizer/index.ts | 10 ++++++++++ packages/vite/src/node/plugins/prepareOutDir.ts | 6 ++++++ pnpm-lock.yaml | 9 +++++++++ 6 files changed, 49 insertions(+) diff --git a/packages/vite/package.json b/packages/vite/package.json index e5fefc2c8fa508..c9773b090e983a 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,6 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { + "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#7ae2c7db6fa8562ff85d45ac66df97fbc6c69958", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index b3a29711cd45cd..61053f2785beb7 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -6,6 +6,7 @@ import { inspect, promisify } from 'node:util' import { performance } from 'node:perf_hooks' import { createRequire } from 'node:module' import crypto from 'node:crypto' +import { ignoreInput, ignoreOutput } from '@voidzero-dev/vite-task-client' import colors from 'picocolors' import picomatch from 'picomatch' import { @@ -2574,6 +2575,16 @@ async function loadConfigFromBundledFile( } } } + if (nodeModulesDir) { + // When run inside Vite Task, the bundled config is written into + // `node_modules/.vite-temp/` and immediately imported back. Tell Vite + // Task to ignore that directory as both input and output so the + // read-write of this transient file doesn't poison the build cache. + // No-op outside Vite Task. + const viteTempDir = path.resolve(nodeModulesDir, '.vite-temp') + ignoreInput(viteTempDir) + ignoreOutput(viteTempDir) + } const hash = `timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}` const tempFileName = nodeModulesDir ? path.resolve( diff --git a/packages/vite/src/node/env.ts b/packages/vite/src/node/env.ts index 9ca5d4d29e4a1f..b7085397a44376 100644 --- a/packages/vite/src/node/env.ts +++ b/packages/vite/src/node/env.ts @@ -2,6 +2,7 @@ import fs from 'node:fs' import path from 'node:path' // eslint-disable-next-line n/no-unsupported-features/node-builtins -- our supported nodejs range supports `parseEnv` but in experimental state, which is fine import { parseEnv } from 'node:util' +import { getEnvs } from '@voidzero-dev/vite-task-client' import { type DotenvPopulateInput, expand } from 'dotenv-expand' import colors from 'picocolors' import { arraify, createDebugger, normalizePath, tryStatSync } from './utils' @@ -82,6 +83,17 @@ export function loadEnv( } } + // When run inside Vite Task, ask it for every env matching each prefix. + // Vite Task adds the glob and its match-set to the build's cache + // fingerprint, so adding/removing/changing a matching env invalidates the + // cache. `getEnvs` also populates `process.env` for names Vite Task knows + // about and that aren't already set, so the loop below picks them up + // alongside inline inherited envs. Outside Vite Task this is a no-op (the + // client cannot connect). + for (const prefix of prefixes) { + getEnvs(`${prefix}*`, { tracked: true }) + } + // check if there are actual env variables starting with VITE_* // these are typically provided inline and should be prioritized for (const key in process.env) { diff --git a/packages/vite/src/node/optimizer/index.ts b/packages/vite/src/node/optimizer/index.ts index b62069ae6367f3..d0c08625cdbcd7 100644 --- a/packages/vite/src/node/optimizer/index.ts +++ b/packages/vite/src/node/optimizer/index.ts @@ -3,6 +3,7 @@ import fsp from 'node:fs/promises' import path from 'node:path' import { promisify } from 'node:util' import { performance } from 'node:perf_hooks' +import { ignoreInput, ignoreOutput } from '@voidzero-dev/vite-task-client' import colors from 'picocolors' import { init, parse } from 'es-module-lexer' import { isDynamicPattern } from 'tinyglobby' @@ -397,6 +398,15 @@ export async function loadCachedDepOptimizationMetadata( const depsCacheDir = getDepsCacheDir(environment) + // When run inside Vite Task, the dep optimizer cache is both read and + // written under this directory (metadata + pre-bundled deps). Tell Vite + // Task to treat it as neither a build input nor a build output: the + // lockfile hash stored in the metadata already drives re-optimization, + // and the cache is process-local scratch space, not a build artifact. + // No-op outside Vite Task. + ignoreInput(depsCacheDir) + ignoreOutput(depsCacheDir) + if (!force) { let cachedMetadata: DepOptimizationMetadata | undefined try { diff --git a/packages/vite/src/node/plugins/prepareOutDir.ts b/packages/vite/src/node/plugins/prepareOutDir.ts index 6f5f16544cabdc..6b00a5fb72acb6 100644 --- a/packages/vite/src/node/plugins/prepareOutDir.ts +++ b/packages/vite/src/node/plugins/prepareOutDir.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import { ignoreInput } from '@voidzero-dev/vite-task-client' import colors from 'picocolors' import type { Plugin } from '../plugin' import { getResolvedOutDirs, resolveEmptyOutDir } from '../watch' @@ -51,6 +52,11 @@ function prepareOutDir( const { publicDir } = environment.config const outDirsArray = [...outDirs] for (const outDir of outDirs) { + // When run inside Vite Task, `emptyDir` below reads the entries of + // `outDir`. Without this, those reads would be recorded as build inputs + // and mix with the writes that follow, tripping Vite Task's read-write + // overlap check. No-op outside Vite Task. + ignoreInput(outDir) if (emptyOutDir !== false && fs.existsSync(outDir)) { // skip those other outDirs which are nested in current outDir const skipDirs = outDirsArray diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b47bb72eb0610d..b5161d2e73ab6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -241,6 +241,9 @@ importers: packages/vite: dependencies: + '@voidzero-dev/vite-task-client': + specifier: github:voidzero-dev/vite-task#7ae2c7db6fa8562ff85d45ac66df97fbc6c69958 + version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958 lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4739,6 +4742,10 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958': + resolution: {gitHosted: true, integrity: sha512-9SGeE62S+17rFYpVL7SGG1UI656M1RidhUdYG5WAIfSUWenCV7vr1omgLCYENU0pDHW0i3FbphVz+72DMLAsGw==, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958} + version: 0.0.0 + '@voidzero-dev/vitepress-theme@4.8.4': resolution: {integrity: sha512-o7R2g9OPu5iLW3R4PNkj+JRSIncO8f1hTY0YvO13OMP/kytKUn8MLhy4kTvx+IMRSLeqrGfrBpze/OEPKzcLUQ==} peerDependencies: @@ -10897,6 +10904,8 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958': {} + '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: '@docsearch/css': 4.5.4 From 16ffb63f43cdfe1c266ddde141c18c3cfa51efe6 Mon Sep 17 00:00:00 2001 From: branchseer Date: Fri, 15 May 2026 12:11:17 +0800 Subject: [PATCH 02/15] chore(deps): use vite task client subdir --- packages/vite/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index c9773b090e983a..5386aadd6abe34 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,7 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#7ae2c7db6fa8562ff85d45ac66df97fbc6c69958", + "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#1d49f00186a4c935187c79507f3364ee0358c9f3&path:/packages/vite-task-client", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5161d2e73ab6d..392b84834eccfa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: packages/vite: dependencies: '@voidzero-dev/vite-task-client': - specifier: github:voidzero-dev/vite-task#7ae2c7db6fa8562ff85d45ac66df97fbc6c69958 - version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958 + specifier: github:voidzero-dev/vite-task#1d49f00186a4c935187c79507f3364ee0358c9f3&path:/packages/vite-task-client + version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4742,8 +4742,8 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958': - resolution: {gitHosted: true, integrity: sha512-9SGeE62S+17rFYpVL7SGG1UI656M1RidhUdYG5WAIfSUWenCV7vr1omgLCYENU0pDHW0i3FbphVz+72DMLAsGw==, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': + resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': @@ -10904,7 +10904,7 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/7ae2c7db6fa8562ff85d45ac66df97fbc6c69958': {} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': {} '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: From 2cb26e4f14f0404ef49ce54c09e14eec6adc9a3f Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 14:41:15 +0800 Subject: [PATCH 03/15] fix: ignore exact bundled config temp file path `loadConfigFromBundledFile` previously told Vite Task to ignore the entire `node_modules/.vite-temp/` directory, but only when `nodeModulesDir` existed. When it didn't (e.g. configs outside a project with `node_modules`), the temp file was written next to the original config and still showed up as both an input and an output of the build, poisoning the Vite Task cache fingerprint. Move the `ignoreInput`/`ignoreOutput` calls below `tempFileName` and pass the exact path that's about to be written. The call is a no-op outside Vite Task, so this is safe in either case. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/src/node/config.ts | 16 ++++++---------- pnpm-lock.yaml | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 61053f2785beb7..6230e62b8ecc6a 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -2575,16 +2575,6 @@ async function loadConfigFromBundledFile( } } } - if (nodeModulesDir) { - // When run inside Vite Task, the bundled config is written into - // `node_modules/.vite-temp/` and immediately imported back. Tell Vite - // Task to ignore that directory as both input and output so the - // read-write of this transient file doesn't poison the build cache. - // No-op outside Vite Task. - const viteTempDir = path.resolve(nodeModulesDir, '.vite-temp') - ignoreInput(viteTempDir) - ignoreOutput(viteTempDir) - } const hash = `timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}` const tempFileName = nodeModulesDir ? path.resolve( @@ -2592,6 +2582,12 @@ async function loadConfigFromBundledFile( `.vite-temp/${path.basename(fileName)}.${hash}.mjs`, ) : `${fileName}.${hash}.mjs` + + // Tell Vite Task to ignore this transient file as both input and output, + // so the read-write of this file doesn't affect the cache fingerprints. + // No-op outside Vite Task. + ignoreInput(tempFileName) + ignoreOutput(tempFileName) await fsp.writeFile(tempFileName, bundledCode) try { return (await import(pathToFileURL(tempFileName).href)).default diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 392b84834eccfa..56dfcd6b1023d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4743,7 +4743,7 @@ packages: resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} + resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': From eede8a74be46208a23dc768df95d40df143e4e2a Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 14:45:31 +0800 Subject: [PATCH 04/15] chore(deps): restore vite-task-client subdir path field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit dropped `path: /packages/vite-task-client` from the resolution metadata in the lockfile. The URL fragment in the resolution key still encodes the subdir, and pnpm 10.33.2 considers the inner field redundant (it rewrites the lockfile without it on `pnpm install`), but pnpm 10.33.4 — the version used by Vite CI — still needs the field to locate the subdir before deciding whether the package has a `prepare` script to run. Without it, CI fetches the tarball, sees the root `vite-task-monorepo` package's `prepare: husky` script, and aborts with `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`. Restore the field so the preview-release CI job (and consumers like the vite-task workspace) can install the tarball. Co-Authored-By: Claude Opus 4.7 (1M context) --- pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 56dfcd6b1023d4..392b84834eccfa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4743,7 +4743,7 @@ packages: resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} + resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': From 9e7306890fcfb975177570f46fd6fba6597b10cc Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 15:05:53 +0800 Subject: [PATCH 05/15] feat: track NODE_ENV in build cache fingerprint via Vite Task The build output branches on `process.env.NODE_ENV` (`isProduction` controls default minification, dev-only warnings, esbuild target, `import.meta.env.PROD/DEV`, etc.), so a different NODE_ENV produces a different bundle. Add `getEnv('NODE_ENV')` from `@voidzero-dev/vite-task-client` before the existing `!!process.env.NODE_ENV` check in `resolveConfig`. The call asks the runner for the env (populating `process.env` if Vite Task knows the value and the local environment hasn't already set it) and registers NODE_ENV as a tracked dependency of the post-run fingerprint, so flipping NODE_ENV between runs invalidates the cache with `tracked env 'NODE_ENV' changed`. No-op outside Vite Task. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/src/node/config.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 6230e62b8ecc6a..54bdc2dd7f805c 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -6,7 +6,11 @@ import { inspect, promisify } from 'node:util' import { performance } from 'node:perf_hooks' import { createRequire } from 'node:module' import crypto from 'node:crypto' -import { ignoreInput, ignoreOutput } from '@voidzero-dev/vite-task-client' +import { + getEnv, + ignoreInput, + ignoreOutput, +} from '@voidzero-dev/vite-task-client' import colors from 'picocolors' import picomatch from 'picomatch' import { @@ -1402,6 +1406,12 @@ export async function resolveConfig( let configFileDependencies: string[] = [] let mode = inlineConfig.mode || defaultMode + // Ask Vite Task for `NODE_ENV` so the env becomes part of the build's + // cache fingerprint and `process.env.NODE_ENV` is populated when only + // Vite Task knows it. Vite's build output branches on the value below + // (`isProduction`), so changing it between runs must invalidate the + // cache. No-op outside Vite Task. + getEnv('NODE_ENV') const isNodeEnvSet = !!process.env.NODE_ENV const packageCache: PackageCache = new Map() From f9746683abbc53de40d9bea6320bfa79b36f9384 Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 15:06:02 +0800 Subject: [PATCH 06/15] feat: disable Vite Task caching for dev server The dev server is a long-running, interactive process whose outputs (network responses served on demand, HMR updates, optimizer state) are not replayable from a cache archive. Call `disableCache()` from `@voidzero-dev/vite-task-client` at the top of `_createServer` so the runner skips storing the run even when the user invokes `vp run --cache dev` or wires a dev task with `cache: true`. Without this, the runner would observe inputs, refuse to store on read/write overlap, or worse attempt to replay a useless archive on the next start. No-op outside Vite Task. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/src/node/server/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 7ed06d8c1c3d29..37f4109973b04f 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -12,6 +12,7 @@ import colors from 'picocolors' import chokidar from 'chokidar' import launchEditorMiddleware from 'launch-editor-middleware' import { determineAgent } from '@vercel/detect-agent' +import { disableCache } from '@voidzero-dev/vite-task-client' import type { SourceMap } from 'rolldown' import type { ModuleRunner } from 'vite/module-runner' import type { FSWatcher, WatchOptions } from '#dep-types/chokidar' @@ -483,6 +484,11 @@ export async function _createServer( previousForceOptimizeOnRestart?: boolean }, ): Promise { + // The dev server is a long-running, interactive process whose outputs + // (network responses, HMR updates) cannot be replayed from a cache, so + // tell Vite Task to skip storing this run. No-op outside Vite Task. + disableCache() + const config = isResolvedConfig(inlineConfig) ? inlineConfig : await resolveConfig(inlineConfig, 'serve') From 8bf4167d70a73292ba21f9df8e395014e9f867cc Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 15:26:25 +0800 Subject: [PATCH 07/15] chore(deps): bump vite-task-client to commit 1aedd944 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new commit upstream of `@voidzero-dev/vite-task-client` refactors the `.node` addon so it exports a `load()` factory rather than the addon's operations directly, and updates the JS wrapper to `require(addon).load()`. The shape of the wrapper's public API is unchanged, but the bundled wrapper code that vite ships in `dist/` must move in lockstep with the addon shape the runner hands the process — so this PR's preview-release build needs to be regenerated against the new commit before vite-task can refresh its lockfile to consume it. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index 5386aadd6abe34..e55f125e154a97 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,7 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#1d49f00186a4c935187c79507f3364ee0358c9f3&path:/packages/vite-task-client", + "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#1aedd944&path:/packages/vite-task-client", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 392b84834eccfa..fb6470b4b21123 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: packages/vite: dependencies: '@voidzero-dev/vite-task-client': - specifier: github:voidzero-dev/vite-task#1d49f00186a4c935187c79507f3364ee0358c9f3&path:/packages/vite-task-client - version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client + specifier: github:voidzero-dev/vite-task#1aedd944&path:/packages/vite-task-client + version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4742,8 +4742,8 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-FTpphztQCfiIu0a4bXM68AZZ3/ubW7dHIgoGHVp4acFd9YFrNFsdoKWpwv+brBq3oBkY8umdwQSotkBQmRhJbA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client': + resolution: {gitHosted: true, integrity: sha512-jlrWxEsachaU1H54Rh000QlYko5AyPnpp6YdgFw7XULGFLHptDSyCd8FH1wWM9gVwJ92e3H5SqWtiz+vKMzjIA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': @@ -10904,7 +10904,7 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1d49f00186a4c935187c79507f3364ee0358c9f3#path:/packages/vite-task-client': {} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client': {} '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: From 877e87d7b25de73328aef851b885256e55aa47d8 Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 16:05:30 +0800 Subject: [PATCH 08/15] chore(deps): bump vite-task-client to commit 137a0003 (full SHA) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two reasons the bump can't stay at the abbreviated `1aedd944`: * pnpm 11 (Vite Task's local pin via `mise`, post-`#383`) refuses to resolve abbreviated GitHub spec SHAs with `[ERROR] Could not resolve 1aedd944 to a commit of …`. Switching to the 40-char form fixes that on both ends. * `137a0003` is the latest commit on the vite-task branch (`runner-aware-tools`) — it bumps the recorded vite-task-client SHA inside `vite-task`'s lockfile and allows `clippy::disallowed_macros` for `napi-derive`'s generated `std::format!`. The wrapper code shipped to vite is identical to `1aedd944`'s, but pointing at the head commit keeps the cross-reference between the two PRs unambiguous. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index e55f125e154a97..355ecda59c5ebc 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,7 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#1aedd944&path:/packages/vite-task-client", + "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#137a00036d031d4c359dfee90dcb1078acc3b99a&path:/packages/vite-task-client", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb6470b4b21123..de56cc6c9a3b5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: packages/vite: dependencies: '@voidzero-dev/vite-task-client': - specifier: github:voidzero-dev/vite-task#1aedd944&path:/packages/vite-task-client - version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client + specifier: github:voidzero-dev/vite-task#137a00036d031d4c359dfee90dcb1078acc3b99a&path:/packages/vite-task-client + version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4742,8 +4742,8 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-jlrWxEsachaU1H54Rh000QlYko5AyPnpp6YdgFw7XULGFLHptDSyCd8FH1wWM9gVwJ92e3H5SqWtiz+vKMzjIA==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client': + resolution: {gitHosted: true, integrity: sha512-Wfi0vVi6Qg1muDNxsgf4YLJZq6DrV32qvf5obYCEaL0Hp7PiLB0L6GCl752a4ZlVdCcpr4/pYRfOLPhdc7PBXg==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': @@ -10904,7 +10904,7 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/1aedd944fdc592585013102dc205abedcb6d7be4#path:/packages/vite-task-client': {} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client': {} '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: From fe814451cd27c28cc550d904324a70310072b9a3 Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 18 May 2026 16:32:10 +0800 Subject: [PATCH 09/15] ci: retrigger node-20 build to retry flaky playground tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Build&Test: node-20, ubuntu-latest` on `0ed26a2ae` timed out twice in `playground/assets/__tests__/relative-base/assets-relative-base.spec.ts` (navigating to `http://localhost:5174/` after `createServer().listen()`) and `playground/fs-serve/__tests__/base/fs-serve-base.spec.ts` (navigating to `http://vite.dev/404`). The previous commit (`8f6364431`) ran the same wrapper code (the SHA bump in `0ed26a2ae` only swaps `1aedd944` → `137a00036d…` and those tree contents at `packages/vite-task-client/` are identical), and node-22, node-24 ubuntu, node-24 macOS, and node-24 Windows all pass. The retry just gives Playwright another shot on that runner. Co-Authored-By: Claude Opus 4.7 (1M context) From 5b54e07fed1b3afabdb4a9f6ef8dbc38480a1458 Mon Sep 17 00:00:00 2001 From: branchseer Date: Thu, 21 May 2026 11:47:46 +0800 Subject: [PATCH 10/15] feat: disable Vite Task caching for preview server The preview server is long-running and interactive, like the dev server, so its run should not be stored in the Vite Task cache. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/src/node/preview.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vite/src/node/preview.ts b/packages/vite/src/node/preview.ts index f4db13030c24c1..123f0d8fa1ebc1 100644 --- a/packages/vite/src/node/preview.ts +++ b/packages/vite/src/node/preview.ts @@ -4,6 +4,7 @@ import sirv from 'sirv' import compression from '@polka/compression' import connect from 'connect' import corsMiddleware from 'cors' +import { disableCache } from '@voidzero-dev/vite-task-client' import type { Connect } from '#dep-types/connect' import type { HttpServer, @@ -126,6 +127,11 @@ export type PreviewServerHook = ( export async function preview( inlineConfig: InlineConfig = {}, ): Promise { + // The preview server is a long-running, interactive process whose + // responses cannot be replayed from a cache, so tell Vite Task to skip + // storing this run. No-op outside Vite Task. + disableCache() + const config = await resolveConfig( inlineConfig, 'serve', From 4e511f6361333c21edd3b6811272830a6fe507f4 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 21 May 2026 15:48:17 +0900 Subject: [PATCH 11/15] chore: simplify comments --- packages/vite/src/node/config.ts | 6 ------ packages/vite/src/node/env.ts | 7 ------- packages/vite/src/node/optimizer/index.ts | 1 - packages/vite/src/node/preview.ts | 3 +-- packages/vite/src/node/server/index.ts | 3 +-- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 54bdc2dd7f805c..7d3379f7bf2427 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1406,11 +1406,6 @@ export async function resolveConfig( let configFileDependencies: string[] = [] let mode = inlineConfig.mode || defaultMode - // Ask Vite Task for `NODE_ENV` so the env becomes part of the build's - // cache fingerprint and `process.env.NODE_ENV` is populated when only - // Vite Task knows it. Vite's build output branches on the value below - // (`isProduction`), so changing it between runs must invalidate the - // cache. No-op outside Vite Task. getEnv('NODE_ENV') const isNodeEnvSet = !!process.env.NODE_ENV const packageCache: PackageCache = new Map() @@ -2595,7 +2590,6 @@ async function loadConfigFromBundledFile( // Tell Vite Task to ignore this transient file as both input and output, // so the read-write of this file doesn't affect the cache fingerprints. - // No-op outside Vite Task. ignoreInput(tempFileName) ignoreOutput(tempFileName) await fsp.writeFile(tempFileName, bundledCode) diff --git a/packages/vite/src/node/env.ts b/packages/vite/src/node/env.ts index b7085397a44376..77ee48725cca63 100644 --- a/packages/vite/src/node/env.ts +++ b/packages/vite/src/node/env.ts @@ -83,13 +83,6 @@ export function loadEnv( } } - // When run inside Vite Task, ask it for every env matching each prefix. - // Vite Task adds the glob and its match-set to the build's cache - // fingerprint, so adding/removing/changing a matching env invalidates the - // cache. `getEnvs` also populates `process.env` for names Vite Task knows - // about and that aren't already set, so the loop below picks them up - // alongside inline inherited envs. Outside Vite Task this is a no-op (the - // client cannot connect). for (const prefix of prefixes) { getEnvs(`${prefix}*`, { tracked: true }) } diff --git a/packages/vite/src/node/optimizer/index.ts b/packages/vite/src/node/optimizer/index.ts index d0c08625cdbcd7..985dde044b7f66 100644 --- a/packages/vite/src/node/optimizer/index.ts +++ b/packages/vite/src/node/optimizer/index.ts @@ -403,7 +403,6 @@ export async function loadCachedDepOptimizationMetadata( // Task to treat it as neither a build input nor a build output: the // lockfile hash stored in the metadata already drives re-optimization, // and the cache is process-local scratch space, not a build artifact. - // No-op outside Vite Task. ignoreInput(depsCacheDir) ignoreOutput(depsCacheDir) diff --git a/packages/vite/src/node/preview.ts b/packages/vite/src/node/preview.ts index 123f0d8fa1ebc1..3ee1995cca9864 100644 --- a/packages/vite/src/node/preview.ts +++ b/packages/vite/src/node/preview.ts @@ -128,8 +128,7 @@ export async function preview( inlineConfig: InlineConfig = {}, ): Promise { // The preview server is a long-running, interactive process whose - // responses cannot be replayed from a cache, so tell Vite Task to skip - // storing this run. No-op outside Vite Task. + // responses cannot be replayed from a cache. disableCache() const config = await resolveConfig( diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 37f4109973b04f..08bc9e44c4178c 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -485,8 +485,7 @@ export async function _createServer( }, ): Promise { // The dev server is a long-running, interactive process whose outputs - // (network responses, HMR updates) cannot be replayed from a cache, so - // tell Vite Task to skip storing this run. No-op outside Vite Task. + // (network responses, HMR updates) cannot be replayed from a cache. disableCache() const config = isResolvedConfig(inlineConfig) From ea9bbe8d8ad66c6996db8403ef12be07761ef630 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Thu, 21 May 2026 15:49:09 +0900 Subject: [PATCH 12/15] chore: simplify comments --- packages/vite/src/node/plugins/prepareOutDir.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/prepareOutDir.ts b/packages/vite/src/node/plugins/prepareOutDir.ts index 6b00a5fb72acb6..e41d7a15dda846 100644 --- a/packages/vite/src/node/plugins/prepareOutDir.ts +++ b/packages/vite/src/node/plugins/prepareOutDir.ts @@ -55,7 +55,7 @@ function prepareOutDir( // When run inside Vite Task, `emptyDir` below reads the entries of // `outDir`. Without this, those reads would be recorded as build inputs // and mix with the writes that follow, tripping Vite Task's read-write - // overlap check. No-op outside Vite Task. + // overlap check. ignoreInput(outDir) if (emptyOutDir !== false && fs.existsSync(outDir)) { // skip those other outDirs which are nested in current outDir From 7119ea3043c0a6ab12cd8273af4598f1a3c81882 Mon Sep 17 00:00:00 2001 From: branchseer Date: Thu, 21 May 2026 17:34:33 +0800 Subject: [PATCH 13/15] refactor: handle process.env at the getEnv/getEnvs call sites `@voidzero-dev/vite-task-client`'s `getEnv`/`getEnvs` no longer mutate `process.env`; they return the value(s) instead. Populate `process.env` here: fall back to the returned `NODE_ENV` in `resolveConfig`, and merge prefixed envs into the resolved env map in `loadEnv`. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/src/node/config.ts | 7 ++++++- packages/vite/src/node/env.ts | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 7d3379f7bf2427..3b416feac49985 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1406,7 +1406,12 @@ export async function resolveConfig( let configFileDependencies: string[] = [] let mode = inlineConfig.mode || defaultMode - getEnv('NODE_ENV') + // `NODE_ENV` may be known only to Vite Task; fetch it from the runner, + // which also records it in the build's cache key. No-op outside Vite Task. + const nodeEnv = process.env.NODE_ENV ?? getEnv('NODE_ENV') + if (nodeEnv !== undefined) { + process.env.NODE_ENV = nodeEnv + } const isNodeEnvSet = !!process.env.NODE_ENV const packageCache: PackageCache = new Map() diff --git a/packages/vite/src/node/env.ts b/packages/vite/src/node/env.ts index 77ee48725cca63..89912848294ef6 100644 --- a/packages/vite/src/node/env.ts +++ b/packages/vite/src/node/env.ts @@ -83,8 +83,11 @@ export function loadEnv( } } + // Vite Task may know prefixed envs not present here; fetch them and let + // the runner record each glob in the build's cache key. The `process.env` + // loop below still takes precedence. No-op outside Vite Task. for (const prefix of prefixes) { - getEnvs(`${prefix}*`, { tracked: true }) + Object.assign(env, getEnvs(`${prefix}*`, { tracked: true })) } // check if there are actual env variables starting with VITE_* From 23ded7bb458062c028d7a52019133c9cfd51b105 Mon Sep 17 00:00:00 2001 From: branchseer Date: Mon, 25 May 2026 17:10:39 +0800 Subject: [PATCH 14/15] chore: integrate updated vite-task-client API + lockfile fix - Adopt the side-effect-free `getEnv`/`getEnvs` shape; the `NODE_ENV` fetch is now guarded by `process.env.NODE_ENV === undefined` so a caller-set value is never overwritten. - Drop the now-default `{ tracked: true }` argument from `getEnvs`. - Bump vite-task-client to commit c1634234. - Add the `path:` field to the lockfile `resolution` for the github tarball; without it pnpm extracts the entire vite-task monorepo into `node_modules/@voidzero-dev/vite-task-client/`. - Allowlist `vite-task-monorepo` in `allowBuilds` so pnpm runs its (now no-op) prepare script during the git-dep flow. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/vite/package.json | 2 +- packages/vite/src/node/config.ts | 12 +++++++----- packages/vite/src/node/env.ts | 5 ++--- pnpm-lock.yaml | 10 +++++----- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index 355ecda59c5ebc..f4f20552de49d4 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,7 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#137a00036d031d4c359dfee90dcb1078acc3b99a&path:/packages/vite-task-client", + "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#c16342348fa3c9a28074d10a338a88e32f3c7858&path:/packages/vite-task-client", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 3b416feac49985..4a9721b1f918db 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1406,11 +1406,13 @@ export async function resolveConfig( let configFileDependencies: string[] = [] let mode = inlineConfig.mode || defaultMode - // `NODE_ENV` may be known only to Vite Task; fetch it from the runner, - // which also records it in the build's cache key. No-op outside Vite Task. - const nodeEnv = process.env.NODE_ENV ?? getEnv('NODE_ENV') - if (nodeEnv !== undefined) { - process.env.NODE_ENV = nodeEnv + // When `NODE_ENV` isn't set locally, ask Vite Task for it; the runner + // also records the env in the build's cache key. + if (process.env.NODE_ENV === undefined) { + const nodeEnv = getEnv('NODE_ENV') + if (nodeEnv !== undefined) { + process.env.NODE_ENV = nodeEnv + } } const isNodeEnvSet = !!process.env.NODE_ENV const packageCache: PackageCache = new Map() diff --git a/packages/vite/src/node/env.ts b/packages/vite/src/node/env.ts index 89912848294ef6..e80c23cd5cfe6f 100644 --- a/packages/vite/src/node/env.ts +++ b/packages/vite/src/node/env.ts @@ -84,10 +84,9 @@ export function loadEnv( } // Vite Task may know prefixed envs not present here; fetch them and let - // the runner record each glob in the build's cache key. The `process.env` - // loop below still takes precedence. No-op outside Vite Task. + // the runner record each glob in the build's cache key. for (const prefix of prefixes) { - Object.assign(env, getEnvs(`${prefix}*`, { tracked: true })) + Object.assign(env, getEnvs(`${prefix}*`)) } // check if there are actual env variables starting with VITE_* diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index de56cc6c9a3b5a..3fc29326b0dfb9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: packages/vite: dependencies: '@voidzero-dev/vite-task-client': - specifier: github:voidzero-dev/vite-task#137a00036d031d4c359dfee90dcb1078acc3b99a&path:/packages/vite-task-client - version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client + specifier: github:voidzero-dev/vite-task#c16342348fa3c9a28074d10a338a88e32f3c7858&path:/packages/vite-task-client + version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4742,8 +4742,8 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-Wfi0vVi6Qg1muDNxsgf4YLJZq6DrV32qvf5obYCEaL0Hp7PiLB0L6GCl752a4ZlVdCcpr4/pYRfOLPhdc7PBXg==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client': + resolution: {gitHosted: true, integrity: sha512-CT7tllvZG+NzajnqgK3y05VZDg6WpvvZ7G561rxajQa6aI1OYMlroR/jKpZhMOyVFLmUZ+lTzdA7cFKWA/jRbQ==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858} version: 0.0.0 '@voidzero-dev/vitepress-theme@4.8.4': @@ -10904,7 +10904,7 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/137a00036d031d4c359dfee90dcb1078acc3b99a#path:/packages/vite-task-client': {} + '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client': {} '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: From f23d916411a250c166a5e7e822f0365eb2222864 Mon Sep 17 00:00:00 2001 From: branchseer Date: Fri, 29 May 2026 11:55:54 +0800 Subject: [PATCH 15/15] chore(deps): use published @voidzero-dev/vite-task-client@^0.1.0 Replaces the in-development git+subpath ref with the freshly published npm version (https://www.npmjs.com/package/@voidzero-dev/vite-task-client/v/0.1.0). --- packages/vite/package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index f4f20552de49d4..12663992b11e9e 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -73,7 +73,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "@voidzero-dev/vite-task-client": "github:voidzero-dev/vite-task#c16342348fa3c9a28074d10a338a88e32f3c7858&path:/packages/vite-task-client", + "@voidzero-dev/vite-task-client": "^0.1.0", "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3fc29326b0dfb9..eee4c93b61f02f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: packages/vite: dependencies: '@voidzero-dev/vite-task-client': - specifier: github:voidzero-dev/vite-task#c16342348fa3c9a28074d10a338a88e32f3c7858&path:/packages/vite-task-client - version: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client + specifier: ^0.1.0 + version: 0.1.0 lightningcss: specifier: ^1.32.0 version: 1.32.0 @@ -4742,9 +4742,9 @@ packages: '@vitest/utils@4.1.7': resolution: {integrity: sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==} - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client': - resolution: {gitHosted: true, integrity: sha512-CT7tllvZG+NzajnqgK3y05VZDg6WpvvZ7G561rxajQa6aI1OYMlroR/jKpZhMOyVFLmUZ+lTzdA7cFKWA/jRbQ==, path: /packages/vite-task-client, tarball: https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858} - version: 0.0.0 + '@voidzero-dev/vite-task-client@0.1.0': + resolution: {integrity: sha512-8yk/v8L9WmeKnhThAP0Px8RQawwRUAAt0dxqkK6UOpOULkXQvLWkxX8n/A8CTMslsUS2u3vOLGD1Q/cNz4VWRQ==} + engines: {node: '>=18'} '@voidzero-dev/vitepress-theme@4.8.4': resolution: {integrity: sha512-o7R2g9OPu5iLW3R4PNkj+JRSIncO8f1hTY0YvO13OMP/kytKUn8MLhy4kTvx+IMRSLeqrGfrBpze/OEPKzcLUQ==} @@ -10904,7 +10904,7 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - '@voidzero-dev/vite-task-client@https://codeload.github.com/voidzero-dev/vite-task/tar.gz/c16342348fa3c9a28074d10a338a88e32f3c7858#path:/packages/vite-task-client': {} + '@voidzero-dev/vite-task-client@0.1.0': {} '@voidzero-dev/vitepress-theme@4.8.4(focus-trap@8.0.1)(vite@packages+vite)(vitepress@2.0.0-alpha.17)(vue@3.5.34)': dependencies: