Vite creates .vite/deps_temp_* temp files in the project directory unexpectedly #19441
Unanswered
Junah-Park
asked this question in
Q&A
Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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