Vite creates .vite/deps_temp_* temp files in the project directory unexpectedly #19441
Replies: 2 comments
-
Found one solution: By default, Vite creates a .vite folder in your project root for caching. You can instruct it to use a subfolder of node_modules instead. Most people already ignore node_modules, so this automatically keeps any temp files out of Git. Update vite.config.js (or vite.config.ts)
|
Beta Was this translation helpful? Give feedback.
-
Vite creates the vite/packages/vite/src/node/config.ts Lines 1302 to 1309 in ce0ccc6 |
Beta Was this translation helpful? Give feedback.
-
Vite is generating temporary dependency files in my project, specifically inside .vite/deps_temp_* directories. These files unexpectedly get added to Git when I commit changes, and I don't want them polluting my repository.
client/.vite/deps_temp_1ddde431/package.json
Steps to Reproduce
Start a Vite project.
Run the dev server (vite or npm run dev).
Notice that a .vite/deps_temp_* directory is included in the commit.
Expected Behavior
Vite should not create these temp files inside my project workspace.
Workarounds Tried
Adding .vite/ to .gitignore (I do not want to add this to .gitignore).
Modifying vite.config.js:
Vite Version: 5.3.4
OS: CentOS 9
Node Version: 18
How do I prevent these files from being randomly created and staying in my project folder?
Beta Was this translation helpful? Give feedback.
All reactions