Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions guide/api-environment-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Vite サーバーには共有プラグインパイプラインがありますが
## `hotUpdate` フック {#the-hotupdate-hook}

- **型:** `(this: { environment: DevEnvironment }, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>`
- **種類:** `async`、`sequential`
- **参照:** [HMR API](./api-hmr)

`hotUpdate` フックを使用すると、プラグインが指定された環境に対してカスタム HMR 更新処理を実行できるようになります。ファイルが変更されると、HMR アルゴリズムは `server.environments` の順番に従って各環境で順に実行されるので、`hotUpdate` フックは複数回呼び出されることになります。このフックは以下のシグネチャを持つコンテキストオブジェクトを受け取ります:
Expand Down
1 change: 1 addition & 0 deletions guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ Vite プラグインは Vite 特有の目的を果たすフックを提供する
### `handleHotUpdate`

- **型:** `(ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>`
- **種類:** `async`、`sequential`
- **参照:** [HMR API](./api-hmr)

カスタム HMR 更新処理を実行します。このフックは以下のシグネチャーのコンテキストオブジェクトを受け取ります:
Expand Down