Skip to content

Commit 68afebc

Browse files
committed
Apply origin changes
1 parent 748abb1 commit 68afebc

15 files changed

+117
-46
lines changed

changes/hotupdate-hook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
영향을 받는 범위: `Vite 플러그인 개발자`
1010

1111
::: warning 지원 중단
12-
`hotUpdate` was first introduced in `v6.0`. The deprecation of `handleHotUpdate` is planned for a future major. We don't yet recommend moving away from `handleHotUpdate` yet. If you want to experiment and give us feedback, you can use the `future.removePluginHookHandleHotUpdate` to `"warn"` in your vite config.
12+
`hotUpdate` was first introduced in `v6.0`. The deprecation of `handleHotUpdate` is planned for a future major. We don't recommend moving away from `handleHotUpdate` yet. If you want to experiment and give us feedback, you can use the `future.removePluginHookHandleHotUpdate` to `"warn"` in your vite config.
1313
:::
1414

1515
## 배경 {#motivation}
1616

17-
[`handleHotUpdate` ](/guide/api-plugin.md#handlehotupdate)은 커스텀 HMR 업데이트 처리를 수행할 수 있게 해줍니다. 업데이트될 모듈 목록이 `HmrContext`로 전달됩니다:
17+
The [`handleHotUpdate` hook](/guide/api-plugin.md#handlehotupdate) allows to perform custom HMR update handling. A list of modules to be updated is passed in the `HmrContext`.
1818

1919
```ts
2020
interface HmrContext {

changes/per-environment-apis.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ The `Environment` instance was first introduced at `v6.0`. The deprecation of `s
1414
```ts
1515
future: {
1616
removeServerModuleGraph: 'warn',
17+
removeServerReloadModule: 'warn',
18+
removeServerPluginContainer: 'warn',
19+
removeServerHot: 'warn',
1720
removeServerTransformRequest: 'warn',
21+
removeServerWarmupRequest: 'warn',
1822
}
1923
```
2024

@@ -29,5 +33,8 @@ Vite v6에서는 임의의 수의 커스텀 환경(`client`, `ssr`, `edge` 등)
2933
## 마이그레이션 가이드 {#migration-guide}
3034

3135
- `server.moduleGraph` -> [`environment.moduleGraph`](/guide/api-environment-instances#separate-module-graphs)
36+
- `server.reloadModule(module)` -> `environment.reloadModule(module)`
37+
- `server.pluginContainer` -> `environment.pluginContainer`
3238
- `server.transformRequest(url, ssr)` -> `environment.transformRequest(url)`
33-
- `server.warmupRequest(url, ssr)` -> `environment.warmupRequest(url)`
39+
- `server.warmupRequest(url, ssr)` -> `environment.warmupRequest(url)`
40+
- `server.hot` -> `server.client.environment.hot`

changes/ssr-using-modulerunner.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ Affected scope: `Vite Plugin Authors`
1818

1919
## 마이그레이션 가이드 {#migration-guide}
2020

21-
[프레임워크를 위한 환경 API 가이드](../guide/api-environment-frameworks.md)를 참고하세요.
21+
[프레임워크를 위한 환경 API 가이드](../guide/api-environment-frameworks.md)를 참고하세요.
22+
23+
`server.ssrFixStacktrace` and `server.ssrRewriteStacktrace` does not have to be called when using the Module Runner APIs. The stack traces will be updated unless `sourcemapInterceptor` is set to `false`.

config/dep-optimization-options.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
별도로 명시되지 않은 한, 이 섹션의 옵션들은 개발 환경에서만 사용되는 디펜던시 최적화 도구에만 적용됩니다.
66

7-
## optimizeDeps.entries {#optimizedeps-entries}
7+
## optimizeDeps.entries <NonInheritBadge />
88

99
- **타입:** `string | string[]`
1010

1111
기본적으로 Vite는 모든 `.html` 파일을 크롤링해 사전 번들링이 필요한 디펜던시를 탐지합니다(`node_modules`, `build.outDir`, `__tests__``coverage` 디렉터리는 무시). 만약 `build.rollupOptions.input`이 지정된 경우 Vite가 대신 해당 진입점을 탐색합니다.
1212

1313
If neither of these fit your needs, you can specify custom entries using this option - the value should be a [`tinyglobby` pattern](https://github.com/SuperchupuDev/tinyglobby) or array of patterns that are relative from Vite project root. This will overwrite default entries inference. Only `node_modules` and `build.outDir` folders will be ignored by default when `optimizeDeps.entries` is explicitly defined. If other folders need to be ignored, you can use an ignore pattern as part of the entries list, marked with an initial `!`. `node_modules` will not be ignored for patterns that explicitly include the string `node_modules`.
1414

15-
## optimizeDeps.exclude {#optimizedeps-exclude}
15+
## optimizeDeps.exclude <NonInheritBadge />
1616

1717
- **타입:** `string[]`
1818

@@ -33,7 +33,7 @@ export default defineConfig({
3333

3434
:::
3535

36-
## optimizeDeps.include {#optimizedeps-include}
36+
## optimizeDeps.include <NonInheritBadge />
3737

3838
- **타입:** `string[]`
3939

@@ -51,7 +51,7 @@ export default defineConfig({
5151
})
5252
```
5353

54-
## optimizeDeps.esbuildOptions {#optimizedeps-esbuildoptions}
54+
## optimizeDeps.esbuildOptions <NonInheritBadge />
5555

5656
- **타입:** [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)`<`[`EsbuildBuildOptions`](https://esbuild.github.io/api/#general-options)`,
5757
| 'bundle'
@@ -72,28 +72,28 @@ export default defineConfig({
7272
- `external`은 생략됩니다. 이 대신 Vite의 `optimizeDeps.exclude` 옵션을 사용합니다.
7373
- `plugins`는 Vite의 디펜던시 플러그인과 병합됩니다.
7474

75-
## optimizeDeps.force {#optimizedeps-force}
75+
## optimizeDeps.force <NonInheritBadge />
7676

7777
- **타입:** `boolean`
7878

7979
`true`로 설정하면 최적화되어 캐시된 디펜던시들을 무시하고, 디펜던시 사전 번들링을 강제로 실행합니다.
8080

81-
## optimizeDeps.noDiscovery
81+
## optimizeDeps.noDiscovery <NonInheritBadge />
8282

8383
- **Type:** `boolean`
8484
- **Default:** `false`
8585

8686
When set to `true`, automatic dependency discovery will be disabled and only dependencies listed in `optimizeDeps.include` will be optimized. CJS-only dependencies must be present in `optimizeDeps.include` during dev.
8787

88-
## optimizeDeps.holdUntilCrawlEnd {#optimizedeps-holduntilcrawlend}
88+
## optimizeDeps.holdUntilCrawlEnd <NonInheritBadge />
8989

9090
- **실험적 기능**: [이 곳에 피드백을 남겨주세요](https://github.com/vitejs/vite/discussions/15834)
9191
- **타입:** `boolean`
9292
- **기본값:** `true`
9393

9494
이 옵션이 활성화되어 있으면 콜드 스타트 시 모든 정적 에셋이 크롤링될 때까지 디펜던시 최적화가 완료되지 않습니다. 이는 크롤링 도중 새로운 디펜던시가 발견되어 공통 청크를 다시 만들어야 하는 경우 전체 페이지를 다시 로드해야 하는 상황을 피할 수 있습니다(자세한 설명은 [이 코멘트](https://github.com/vitejs/vite/pull/8869#issuecomment-1172902125)를 참고해 주세요. - 옮긴이). 만약 디펜던시 스캐너로 `include`에 정의된 목록을 포함해 모든 디펜던시를 찾을 수 있다면, 브라우저가 병렬로 더 많은 요청을 처리할 수 있도록 이 옵션을 비활성화하는 것이 좋습니다.
9595

96-
## optimizeDeps.disabled {#optimizedeps-disabled}
96+
## optimizeDeps.disabled <NonInheritBadge />
9797

9898
- **지원 중단 예정**
9999
- **실험적 기능:** [이 곳에 피드백을 남겨주세요](https://github.com/vitejs/vite/discussions/13839)
@@ -108,7 +108,7 @@ When set to `true`, automatic dependency discovery will be disabled and only dep
108108
빌드 중 디펜던시를 최적화하는 것은 **실험적** 기능이었습니다. 이 전략을 시도하는 프로젝트는 `build.commonjsOptions: { include: [] }`를 사용해 `@rollup/plugin-commonjs`를 제거해야 합니다. 이렇게 했다면 번들링 중 CJS 패키지를 지원하기 위해 다시 활성화하도록 안내하는 경고가 표시됩니다.
109109
:::
110110

111-
## optimizeDeps.needsInterop {#optimizedeps-needsinterop}
111+
## optimizeDeps.needsInterop <NonInheritBadge />
112112

113113
- **실험적 기능**
114114
- **타입:** `string[]`

config/preview-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ TLS + HTTP/2를 활성화합니다.
8080

8181
프리뷰 서버에 대한 커스텀 프록시 규칙을 설정할 수 있습니다. `{ key: options }` 형태로 구성되며, 키값이 `^`로 시작하는 경우 `RegExp`로 해석됩니다. `configure` 옵션을 사용하여 프록시 인스턴스에 접근할 수 있습니다.
8282

83-
이는 [`http-proxy`](https://github.com/http-party/node-http-proxy)를 사용하며, 더 많은 옵션은 [이 링크](https://github.com/http-party/node-http-proxy#options)를 참고해주세요.
83+
Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3). Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
8484

8585
## preview.cors {#preview-cors}
8686

config/server-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default defineConfig({
122122

123123
참고로 [`base`](/config/shared-options.md#base)가 비상대적(Non-relative)인 경우, 각 키에 `base`를 접두사로 붙여야 합니다.
124124

125-
이 옵션은 [`http-proxy`](https://github.com/http-party/node-http-proxy#options)를 확장합니다. 추가 옵션은 [여기](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/proxy.ts#L13)를 참고해 주세요.
125+
Extends [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3#options). Additional options are [here](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/proxy.ts#L13).
126126

127127
특정 상황(예: 서버 내부에서 사용되는 [connect](https://github.com/senchalabs/connect) 앱에 커스텀 미들웨어 추가)에서는 개발 서버를 직접 구성해야 할 수도 있습니다. 이를 위해서는 [플러그인](/guide/using-plugins.html)을 작성하고, [configureServer](/guide/api-plugin.html#configureserver) 훅을 이용해야 합니다. 자세한 것은 각 문서를 참고해주세요.
128128

config/shared-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ declare const __APP_VERSION__: string
114114
SSR 빌드의 경우, `build.rollupOptions.output`을 통해 구성된 ESM 빌드 결과물에 대해 중복된 코드의 제거가 진행되지 않습니다. 이를 해결하기 위해서는 ESM이 모듈 로드에 대한 플러그인 지원을 개선할 때까지 CJS(CommonJS) 빌드를 이용하는 것입니다.
115115
:::
116116
117-
## resolve.conditions {#resolve-conditions}
117+
## resolve.conditions <NonInheritBadge />
118118
119119
- **타입:** `string[]`
120120
- **기본값:** `['module', 'browser', 'development|production']` (`defaultClientConditions`)
@@ -140,7 +140,7 @@ SSR 빌드의 경우, `build.rollupOptions.output`을 통해 구성된 ESM 빌
140140

141141
참고로 `import`, `require`, `default` 조건은 요구사항이 충족되면 항상 적용됩니다.
142142

143-
## resolve.mainFields {#resolve-mainfields}
143+
## resolve.mainFields <NonInheritBadge />
144144

145145
- **타입:** `string[]`
146146
- **기본값:** `['browser', 'module', 'jsnext:main', 'jsnext']` (`defaultClientConditions`)

guide/api-environment-runtimes.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,17 @@ export class ModuleRunner {
153153
**사용 예시:**
154154

155155
```js
156-
import { ModuleRunner, ESModulesEvaluator } from 'vite/module-runner'
156+
import {
157+
ModuleRunner,
158+
ESModulesEvaluator,
159+
createNodeImportMeta,
160+
} from 'vite/module-runner'
157161
import { transport } from './rpc-implementation.js'
158162

159163
const moduleRunner = new ModuleRunner(
160164
{
161165
transport,
166+
createImportMeta: createNodeImportMeta, // if the module runner runs in Node.js
162167
},
163168
new ESModulesEvaluator(),
164169
)
@@ -278,7 +283,11 @@ RPC를 이용하거나 직접 함수를 호출해 환경과 통신하는 전송
278283
```js [worker.js]
279284
import { parentPort } from 'node:worker_threads'
280285
import { fileURLToPath } from 'node:url'
281-
import { ESModulesEvaluator, ModuleRunner } from 'vite/module-runner'
286+
import {
287+
ESModulesEvaluator,
288+
ModuleRunner,
289+
createNodeImportMeta,
290+
} from 'vite/module-runner'
282291

283292
/** @type {import('vite/module-runner').ModuleRunnerTransport} */
284293
const transport = {
@@ -294,6 +303,7 @@ const transport = {
294303
const runner = new ModuleRunner(
295304
{
296305
transport,
306+
createImportMeta: createNodeImportMeta,
297307
},
298308
new ESModulesEvaluator(),
299309
)

guide/api-environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
}
7171
```
7272

73-
환경은 기본적으로 최상위 설정 옵션을 상속합니다(예: 새로운 `server``edge` 환경은 `build.sourcemap: false` 옵션을 상속). 다만 `optimizeDeps`와 같은 일부 최상위 옵션은 서버 환경에서 기본값으로 잘 적용되지 않는 경우가 있어 `client` 환경에만 적용됩니다. 참고로 `client` 환경 역시 `environments.client`로 명시적인 구성이 가능하지만, 새로운 환경 추가 시 클라이언트 설정이 변경될 수 있기에 최상위 옵션 사용을 권장합니다.
73+
When not explicitly documented, environment inherits the configured top-level config options (for example, the new `server` and `edge` environments will inherit the `build.sourcemap: false` option). A small number of top-level options, like `optimizeDeps`, only apply to the `client` environment, as they don't work well when applied as a default to server environments. Those options have <NonInheritBadge /> badge in [the reference](/config/). The `client` environment can also be configured explicitly through `environments.client`, but we recommend to do it with the top-level options so the client config remains unchanged when adding new environments.
7474

7575
`EnvironmentOptions` 인터페이스는 모든 환경별 옵션을 나타냅니다. `resolve`처럼 `build``dev` 모두에 적용되는 환경 옵션이 있고, `DevEnvironmentOptions``BuildEnvironmentOptions`처럼 개발 및 빌드별 옵션(`dev.warmup` 또는 `build.outDir`같은)이 있습니다. `optimizeDeps`같은 일부 옵션은 개발 시에만 적용되지만, 하위 호환성을 위해 `dev` 대신 최상위 레벨에 위치합니다.
7676

guide/api-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Vite는 확립된 패턴을 제공하기 위해 노력하고 있습니다. 따
1212

1313
::: tip
1414
플러그인을 학습하거나, 디버깅 또는 새롭게 작성할 때, 프로젝트에 [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect)를 설치하는 것이 좋습니다. 이 모듈은 `localhost:5173/__inspect/`를 통해 Vite 플러그인의 중간 상태를 검사할 수 있도록 도와줍니다. 더 자세한 사항은 [vite-plugin-inspect 문서](https://github.com/antfu/vite-plugin-inspect)를 참고해주세요.
15-
![vite-plugin-inspect](/images/vite-plugin-inspect.png)
15+
![vite-plugin-inspect](../images/vite-plugin-inspect.png)
1616
:::
1717

1818
## 플러그인 작성 규칙 {#conventions}

0 commit comments

Comments
 (0)