From 1c715238d5a32fe28b8a61a2d4768a6ef25954b6 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Wed, 30 Oct 2024 00:29:41 +0900 Subject: [PATCH 1/2] feat!: update to chokidar v4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolve #1668 https://github.com/vitejs/vite/commit/192d555f88bba7576e8a40cc027e8a11e006079c の反映です。 --- config/server-options.md | 4 ++-- guide/api-javascript.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/server-options.md b/config/server-options.md index 76c67d59..621b99c1 100644 --- a/config/server-options.md +++ b/config/server-options.md @@ -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` 内のファイルの監視 diff --git a/guide/api-javascript.md b/guide/api-javascript.md index c1b17e71..749af21d 100644 --- a/guide/api-javascript.md +++ b/guide/api-javascript.md @@ -110,7 +110,7 @@ interface ViteDevServer { httpServer: http.Server | null /** * chokidar watcher のインスタンス。`config.server.watch` が `null` に - * 設定されている場合、何もしないイベントエミッターを返します。 + * 設定されている場合、いかなるファイルも監視せず、`add` を呼び出しても何も起こりません。 * https://github.com/paulmillr/chokidar#api */ watcher: FSWatcher From 14582dc827257f161be0eb08d52635d287b5d7df Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Wed, 30 Oct 2024 21:06:05 +0900 Subject: [PATCH 2/2] Update guide/api-javascript.md Co-authored-by: Jun Shindo <46585162+jay-es@users.noreply.github.com> --- guide/api-javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/api-javascript.md b/guide/api-javascript.md index 749af21d..1c930b1d 100644 --- a/guide/api-javascript.md +++ b/guide/api-javascript.md @@ -111,7 +111,7 @@ interface ViteDevServer { /** * chokidar watcher のインスタンス。`config.server.watch` が `null` に * 設定されている場合、いかなるファイルも監視せず、`add` を呼び出しても何も起こりません。 - * https://github.com/paulmillr/chokidar#api + * https://github.com/paulmillr/chokidar#getting-started */ watcher: FSWatcher /**