From 4b8cc54c8ca00ce2ac0a7f2a10fc8b4b01df8445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=ED=98=81?= Date: Wed, 27 Aug 2025 12:47:14 +0900 Subject: [PATCH 1/3] docs(config): fix type of preview.allowedHosts to 'string[] | true' (#20688) --- config/preview-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/preview-options.md b/config/preview-options.md index acab6a34..440cabf2 100644 --- a/config/preview-options.md +++ b/config/preview-options.md @@ -21,7 +21,7 @@ See [`server.host`](./server-options#server-host) for more details. ## preview.allowedHosts -- **Type:** `string | true` +- **Type:** `string[] | true` - **Default:** [`server.allowedHosts`](./server-options#server-allowedhosts) The hostnames that Vite is allowed to respond to. From e98ffcb8165576e642e360934067a8e6dfcee758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=ED=98=81?= Date: Wed, 27 Aug 2025 13:05:05 +0900 Subject: [PATCH 2/3] docs(server): add reference link for 'server.watcher' null behavior (#20687) --- config/server-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/server-options.md b/config/server-options.md index 62bdcc4d..6e646c97 100644 --- a/config/server-options.md +++ b/config/server-options.md @@ -256,7 +256,7 @@ File system watcher options to pass on to [chokidar](https://github.com/paulmill The Vite server watcher watches the `root` and skips the `.git/`, `node_modules/`, `test-results/`, and Vite's `cacheDir` and `build.outDir` directories by default. When updating a watched file, Vite will apply HMR and update the page only if needed. -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. +If set to `null`, no files will be watched. [`server.watcher`](/guide/api-javascript.html#vitedevserver) will provide a compatible event emitter, but calling `add` or `unwatch` will have no effect. ::: warning Watching files in `node_modules` From c1849be0c0fec1710227299bc5127abc558f7784 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 28 Aug 2025 10:10:14 +0800 Subject: [PATCH 3/3] fix: resolved conflict --- config/preview-options.md | 7 +------ config/server-options.md | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/config/preview-options.md b/config/preview-options.md index d4b42286..c178215d 100644 --- a/config/preview-options.md +++ b/config/preview-options.md @@ -21,13 +21,8 @@ ## preview.allowedHosts -<<<<<<< HEAD -- **类型:** `string | true` +- **类型:** `string[] | true` - **默认:** [`server.allowedHosts`](./server-options#server-allowedhosts) -======= -- **Type:** `string[] | true` -- **Default:** [`server.allowedHosts`](./server-options#server-allowedhosts) ->>>>>>> e98ffcb8165576e642e360934067a8e6dfcee758 Vite 允许响应的主机名。 diff --git a/config/server-options.md b/config/server-options.md index 10605d52..289529b9 100644 --- a/config/server-options.md +++ b/config/server-options.md @@ -256,11 +256,7 @@ export default defineConfig({ Vite 服务器的文件监听器默认会监听 `root` 目录,同时会跳过 `.git/`、`node_modules/`、`test-results/`, 以及 Vite 的 `cacheDir` 和 `build.outDir` 这些目录。当监听到文件更新时,Vite 会应用 HMR 并且只在需要时更新页面。 -<<<<<<< HEAD -如果设置为 `null`,则不会监视任何文件。`server.watcher` 将提供兼容的事件发射器,但调用 `add` 或 `unwatch` 将不起作用。 -======= -If set to `null`, no files will be watched. [`server.watcher`](/guide/api-javascript.html#vitedevserver) will provide a compatible event emitter, but calling `add` or `unwatch` will have no effect. ->>>>>>> e98ffcb8165576e642e360934067a8e6dfcee758 +如果设置为 `null`,则不会监视任何文件。[`server.watcher`](/guide/api-javascript.html#vitedevserver) 将提供兼容的事件发射器,但调用 `add` 或 `unwatch` 将不起作用。 ::: warning 监听 `node_modules` 中的文件