Skip to content

Commit f014157

Browse files
authored
Merge pull request #1188 from vitejs/dev
merge dev into main
2 parents fcff511 + 2b28dfd commit f014157

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

config/preview-options.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export default defineConfig({
6060
- **类型:** `https.ServerOptions`
6161
- **默认:** [`server.https`](./server-options#server-https)
6262

63-
启用 TLS + HTTP/2。注意,只有在与 [`server.proxy` 选项](./server-options#server-proxy) 同时使用时,才会降级为 TLS。
63+
启用 TLS + HTTP/2。
6464

65-
该值也可以传递给 `https.createServer()`[options 对象](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener)
65+
有关更多详细信息,请参阅 [`server.https`](./server-options#server-https)
6666

6767
## preview.open {#preview-open}
6868

config/server-options.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Vite允许响应的主机名。
9090

9191
- **类型:** `https.ServerOptions`
9292

93-
启用 TLS + HTTP/2。注意:当 [`server.proxy` 选项](#server-proxy) 也被使用时,将会仅使用 TLS
93+
启用 TLS + HTTP/2。该值是传递给 `https.createServer()`[options 对象](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener)
9494

95-
这个值也可以是一个传递给 `https.createServer()`[选项对象](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener)
95+
请注意,仅当同时使用 [`server.proxy` 选项](#server-proxy) 时,才会降级为 TLS
9696

9797
需要一个合法可用的证书。对基本使用的配置需求来说,你可以添加 [@vitejs/plugin-basic-ssl](https://github.com/vitejs/vite-plugin-basic-ssl) 到项目插件中,它会自动创建和缓存一个自签名的证书。但我们推荐你创建和使用你自己的证书。
9898

guide/api-hmr.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Vite 通过特殊的 `import.meta.hot` 对象暴露手动 HMR API。
1010

1111
```ts twoslash
1212
import type { ModuleNamespace } from 'vite/types/hot.d.ts'
13-
import type { InferCustomEventPayload } from 'vite/types/customEvent.d.ts'
13+
import type {
14+
CustomEventName,
15+
InferCustomEventPayload,
16+
} from 'vite/types/customEvent.d.ts'
1417

1518
// ---cut---
1619
interface ImportMeta {
@@ -32,15 +35,18 @@ interface ViteHotContext {
3235
prune(cb: (data: any) => void): void
3336
invalidate(message?: string): void
3437

35-
on<T extends string>(
38+
on<T extends CustomEventName>(
3639
event: T,
3740
cb: (payload: InferCustomEventPayload<T>) => void,
3841
): void
39-
off<T extends string>(
42+
off<T extends CustomEventName>(
4043
event: T,
4144
cb: (payload: InferCustomEventPayload<T>) => void,
4245
): void
43-
send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void
46+
send<T extends CustomEventName>(
47+
event: T,
48+
data?: InferCustomEventPayload<T>,
49+
): void
4450
}
4551
```
4652

0 commit comments

Comments
 (0)