Skip to content

Commit 53e9932

Browse files
authored
Merge pull request #1411 from vitejs/main
m2d
2 parents 98efe49 + 7a0f6f8 commit 53e9932

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

guide/api-environment-frameworks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const server = await createServer({
142142
createEnvironment(name, config) {
143143
return createFetchableDevEnvironment(name, config, {
144144
handleRequest(request: Request): Promise<Response> | Response {
145-
// handle Request and return a Response
145+
// 处理请求和返回响应
146146
},
147147
})
148148
},
@@ -151,7 +151,7 @@ const server = await createServer({
151151
},
152152
})
153153

154-
// Any consumer of the environment API can now call `dispatchFetch`
154+
// 环境 API 的任何使用者现在都可以调用 `dispatchFetch`
155155
if (isFetchableDevEnvironment(server.environments.custom)) {
156156
const response: Response = await server.environments.custom.dispatchFetch(
157157
new Request('/request-to-handle'),

guide/api-environment-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Vite 服务器有一个共享的插件管道,但在处理模块时,它总是
5656

5757
```ts
5858
configEnvironment(name: string, options: EnvironmentOptions) {
59-
// add "workerd" condition to the rsc environment
59+
// "workerd" 条件增加到 rsc 环境
6060
if (name === 'rsc') {
6161
return {
6262
resolve: {

guide/api-environment-runtimes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ import { transport } from './rpc-implementation.js'
163163
const moduleRunner = new ModuleRunner(
164164
{
165165
transport,
166-
createImportMeta: createNodeImportMeta, // if the module runner runs in Node.js
166+
createImportMeta: createNodeImportMeta, // 如果模块运行程序在 Node.js 中运行
167167
},
168168
new ESModulesEvaluator(),
169169
)
@@ -325,7 +325,7 @@ function createWorkerEnvironment(name, config, context) {
325325
const workerHotChannel = {
326326
send: (data) => worker.postMessage(data),
327327
on: (event, handler) => {
328-
// client is already connected
328+
// 客户端已连接
329329
if (event === 'vite:client:connect') return
330330
if (event === 'vite:client:disconnect') {
331331
const listener = () => {
@@ -399,7 +399,7 @@ export const runner = new ModuleRunner(
399399
return response.json()
400400
},
401401
},
402-
hmr: false, // disable HMR as HMR requires transport.connect
402+
hmr: false, // 禁用 HMR,因为 HMR 需要 transport.connect
403403
},
404404
new ESModulesEvaluator(),
405405
)

0 commit comments

Comments
 (0)