Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/server-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ export default defineConfig({

- **型:** `object| null`

[chokidar](https://github.com/paulmillr/chokidar#api) に渡すファイルシステムウォッチャーのオプションです。
[chokidar](https://github.com/paulmillr/chokidar#getting-started) に渡すファイルシステムウォッチャーのオプションです。`ignored` オプションが渡された場合、Vite は文字列を [picomatch のパターン](https://github.com/micromatch/picomatch#globbing-features)として自動的に変換します

Vite サーバーのウォッチャーはデフォルトで `root` を監視し、`.git/`、`node_modules/`、および Vite の `cacheDir` と `build.outDir` ディレクトリーをスキップします。監視されているファイルを更新すると Vite は HMR を適用し、必要な場合にのみページを更新します。

`null` に設定すると、ファイルは監視されません。`server.watcher` は互換性のあるイベントエミッターを返しますが、`add` や `unwatch` を呼び出しても何も起こりません。
`null` に設定すると、ファイルは監視されません。`server.watcher` はいかなるファイルも監視せず、`add` を呼び出しても何も起こりません。

::: warning `node_modules` 内のファイルの監視

Expand Down
4 changes: 2 additions & 2 deletions guide/api-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ interface ViteDevServer {
httpServer: http.Server | null
/**
* chokidar watcher のインスタンス。`config.server.watch` が `null` に
* 設定されている場合、何もしないイベントエミッターを返します
* https://github.com/paulmillr/chokidar#api
* 設定されている場合、いかなるファイルも監視せず、`add` を呼び出しても何も起こりません
* https://github.com/paulmillr/chokidar#getting-started
*/
watcher: FSWatcher
/**
Expand Down