File tree 3 files changed +14
-8
lines changed
3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ export default defineConfig({
60
60
- ** 类型:** ` https.ServerOptions `
61
61
- ** 默认:** [ ` server.https ` ] ( ./server-options#server-https )
62
62
63
- 启用 TLS + HTTP/2。注意,只有在与 [ ` server.proxy ` 选项 ] ( ./server-options#server-proxy ) 同时使用时,才会降级为 TLS。
63
+ 启用 TLS + HTTP/2。
64
64
65
- 该值也可以传递给 ` https.createServer() ` 的 [ options 对象 ] ( https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener ) 。
65
+ 有关更多详细信息,请参阅 [ ` server.https ` ] ( ./server-options#server-https ) 。
66
66
67
67
## preview.open {#preview-open}
68
68
Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ Vite允许响应的主机名。
90
90
91
91
- ** 类型:** ` https.ServerOptions `
92
92
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 ) 。
94
94
95
- 这个值也可以是一个传递给 ` https.createServer() ` 的 [ 选项对象 ] ( https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener ) 。
95
+ 请注意,仅当同时使用 [ ` server.proxy ` 选项 ] ( #server-proxy ) 时,才会降级为 TLS 。
96
96
97
97
需要一个合法可用的证书。对基本使用的配置需求来说,你可以添加 [ @vitejs/plugin-basic-ssl ] ( https://github.com/vitejs/vite-plugin-basic-ssl ) 到项目插件中,它会自动创建和缓存一个自签名的证书。但我们推荐你创建和使用你自己的证书。
98
98
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ Vite 通过特殊的 `import.meta.hot` 对象暴露手动 HMR API。
10
10
11
11
``` ts twoslash
12
12
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'
14
17
15
18
// ---cut---
16
19
interface ImportMeta {
@@ -32,15 +35,18 @@ interface ViteHotContext {
32
35
prune(cb : (data : any ) => void ): void
33
36
invalidate(message ? : string ): void
34
37
35
- on<T extends string >(
38
+ on<T extends CustomEventName >(
36
39
event : T ,
37
40
cb : (payload : InferCustomEventPayload <T >) => void ,
38
41
): void
39
- off<T extends string >(
42
+ off<T extends CustomEventName >(
40
43
event : T ,
41
44
cb : (payload : InferCustomEventPayload <T >) => void ,
42
45
): 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
44
50
}
45
51
```
46
52
You can’t perform that action at this time.
0 commit comments