You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/server-options.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,8 +169,6 @@ The error that appears in the Browser when the fallback happens can be ignored.
169
169
170
170
File system watcher options to pass on to [chokidar](https://github.com/paulmillr/chokidar#api).
171
171
172
-
When running Vite on Windows Subsystem for Linux (WSL) 2, if the project folder resides in a Windows filesystem, you'll need to set this option to `{ usePolling: true }`. This is due to [a WSL2 limitation](https://github.com/microsoft/WSL/issues/4739) with the Windows filesystem.
173
-
174
172
The Vite server watcher skips `.git/` and `node_modules/` directories by default. If you want to watch a package inside `node_modules/`, you can pass a negated glob pattern to `server.watch.ignored`. That is:
::: warning Using Vite on Windows Subsystem for Linux (WSL) 2
190
+
191
+
When running Vite on WSL2, file system watching does not work when a file is edited by Windows applications (non-WSL2 process). This is due to [a WSL2 limitation](https://github.com/microsoft/WSL/issues/4739). This also applies to running on Docker with a WSL2 backend.
192
+
193
+
To fix it, you could either:
194
+
195
+
-**Recommended**: Use WSL2 applications to edit your files.
196
+
- It is also recommended to move the project folder outside of a Windows filesystem. Accessing Windows filesystem from WSL2 is slow. Removing that overhead will improve performance.
197
+
- Set `{ usePolling: true }`.
198
+
- Note that [`usePolling` leads to high CPU utilization](https://github.com/paulmillr/chokidar#performance).
0 commit comments