Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/update js plugin #99

Merged
merged 2 commits into from
Jun 7, 2024
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
2 changes: 1 addition & 1 deletion docs/api/hmr-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (import.meta.hot) {
The same as Vite, Farm provides type definitions for `import.meta.hot` in `@farmfe/core/client.d.ts`. You can create an `env.d.ts` in the src directory so TypeScript picks up the type definitions:

```ts
/// <reference types="@farmfe/client/client" />
/// <reference types="@farmfe/core/client" />
```

## hot.accept()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (import.meta.hot) {
和 Vite 一样,Farm 在 @farmfe/core/client.d.ts 中提供了 import.meta.hot 的类型定义。 您可以在 src 目录中创建一个 `env.d.ts` ,以便 TypeScript 获取类型定义:

```ts
/// <reference types="@farmfe/client/client" />
/// <reference types="@farmfe/core/client" />
```

## hot.accept()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const myPlugin = () => {
- **required: `false`**

:::note
请注意,改钩子仅在开发模式下运行
请注意,该钩子仅在开发模式下运行
:::

当 `Dev Server` 准备就绪时调用,您可以获得开发服务器实例。
Expand Down
Loading