Cache continuously invalidated with dynamic inputs
I maintainer di solito rispondono entro 1 giorno
@wan9chi ci sta già lavorando.
Dal 21/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Describe the bug
given a vite.config.ts that looks roughly like this:
export default defineConfig(({command, mode}) => {
// used by some vite plugin as a temporary directory
const tempDir = `tmp/${mode === "production" ? "prod" : "dev"}`;
return {
run: {
tasks: {
build: {
command: "vp build",
cache: true,
input: [
{auto: true},
`!${tempDir}/**`,
],
output: [
{auto: true},
`!${tempDir}/**`,
],
}
}
},
// rest of vite config
};
});
that is, when run in the production mode the input/output arrays are [{auto: true}, '!tmp/prod/**'], and when run in the development mode the input/output arrays are [{auto: true}, '!tmp/dev/**'].
if you run it the first time with --mode development, it will be a miss and will be properly added to the cache so subsequent runs with --mode development are cache hits.
however, if you then run it with --mode production, it will be a cache miss but it won't get properly added to the cache, so all subsequent calls with --mode production will also be cache misses.
you will get something along the lines of this:
$ pnpm vp run --verbose build --mode development
$ vp build --mode development ○ cache miss: 'vite.config.ts' modified, executing
[...]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate
Task Details:
────────────────────────────────────────────────
[1] [redacted]#build: $ vp build --mode development ✓
→ Cache miss: 'vite.config.ts' modified
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$ pnpm vp run --verbose build --mode development
$ vp build --mode development ◉ cache hit, replaying
[...]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Statistics: 1 tasks • 1 cache hits • 0 cache misses
Performance: 100% cache hit rate, 13.07s saved in total
Task Details:
────────────────────────────────────────────────
[1] [redacted]#build: $ vp build --mode development ✓
→ Cache hit - output replayed - 13.07s saved
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$ pnpm vp run --verbose build --mode production
$ vp build ○ cache miss: input configuration changed, executing
[...]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate
Task Details:
────────────────────────────────────────────────
[1] trxma-frontend#build: $ vp build --mode production ✓
→ Not cached: read and wrote 'tmp/prod/[...]'
$ pnpm vp run --verbose build --mode production
$ vp build ○ cache miss: input configuration changed, executing
[...]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate
Task Details:
────────────────────────────────────────────────
[1] trxma-frontend#build: $ vp build --mode production ✓
→ Not cached: read and wrote 'tmp/prod/[...]'
(I am prefixing shell commands I ran with $, so to distinguish it from when $ was printed to the console, I added two spaces in front of it)
I have not provided a reproduction sample at the moment (I am aware that I checked the box at the bottom), I just want to report this before I forget. I'm going to make a reproduction sample later.
Reproduction
See above
Steps to reproduce
Will be provided when I make a reproduction sample
System Info
`vp env current`: cannot run, see: https://github.com/voidzero-dev/vite-plus/issues/2515
$ pnpm vp --version
VITE+ - The Unified Toolchain for the Web
vp v0.2.9
Local vite-plus:
vite-plus v0.2.9
Tools:
vite v8.2.1
rolldown v1.2.3
vitest v4.1.10
oxfmt v0.62.0
oxlint v1.77.0
oxlint-tsgolint v7.0.2001
tsdown v0.22.14
Used Package Manager
pnpm
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- Lingua principale
- Rust
- Stelle
- 6k
- Fork
- 271
- Merge medio
- 1g 12h
- PR unite (30g)
- 198
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di voidzero-dev/vite-plus
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package managerApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
voidzero-dev/vite-plus#2970 ·
I maintainer di solito rispondono entro 1 giorno
-
PowerShell `vp` wrapper hides failures: `$?` is `True` and `&&` keeps going after `vp` failsForse già presa @fengmk2 l’ha presa 2 giorni fa. Apertabug pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/vite-plus#2934 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Skip the `vpr` hint when the script runs the same built-inForse già presa @kshanxs l’ha presa oggi. Apertapending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
voidzero-dev/vite-plus#2892 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
voidzero-dev/vite-plus#2882 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`lazyPlugins` docs: dynamic import of a local module still slows down config loadingForse già presa @kshanxs l’ha presa oggi. Apertadocumentation pending triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
voidzero-dev/vite-plus#2875 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di voidzero-dev/vite-plus
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rescript-lang/rescript#8765 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
chroma-core/chroma#7879 ·
I maintainer di solito rispondono entro 1 giorno
-
priority middle
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
KATO-Hiro/AtCoderClans#12838 ·
I maintainer di solito rispondono entro 1 giorno
-
clap_complete env (PowerShell): values after a space don't complete in Windows PowerShell 5.1Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno