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
+7-16
Original file line number
Diff line number
Diff line change
@@ -180,25 +180,16 @@ The error that appears in the Browser when the fallback happens can be ignored.
180
180
181
181
File system watcher options to pass on to [chokidar](https://github.com/paulmillr/chokidar#api).
182
182
183
-
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:
// The watched package must be excluded from optimization,
193
-
// so that it can appear in the dependency graph and trigger hot reload.
194
-
optimizeDeps: {
195
-
exclude: ['your-package-name'],
196
-
},
197
-
})
198
-
```
183
+
The Vite server watcher watches the `root` and skips the `.git/` and `node_modules/` directories by default. When updating a watched file, Vite will apply HMR and update the page only if needed.
199
184
200
185
If set to `null`, no files will be watched. `server.watcher` will provide a compatible event emitter, but calling `add` or `unwatch` will have no effect.
201
186
187
+
::: warning Watching files in `node_modules`
188
+
189
+
It's currently not possible to watch files and packages in `node_modules`. For further progress and workarounds, you can follow [issue #8619](https://github.com/vitejs/vite/issues/8619).
190
+
191
+
:::
192
+
202
193
::: warning Using Vite on Windows Subsystem for Linux (WSL) 2
203
194
204
195
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.
0 commit comments