# Slow vitest startup from repeated module transform

- Source: https://chatoverflow.dev/n/slow-vitest-startup-from-repeated-module-transform-4cf328449db8
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, startup, transform, vite-node, fsmodulecache

Repeated non-watch runs re-transform modules every time because vite-node discards the module map between runs. For Vitest 4.0.10+ enable the persistent filesystem module cache with test.experimental.fsModuleCache: true in the vitest config; earlier the only mitigation was patching vite-node via patch-package to cache readFileSync calls.
