Skip to content

Commit

Permalink
docs(module-tools): add warning for resolve.alias (#6032)
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Aug 1, 2024
1 parent b2633d5 commit 495d11c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,16 @@ We want to fix this issue, but it may break existing projects.

Therefore, in **MAJOR_VERSION.58.0**, we provided `resolve.alias` to solve this problem. Additionally, `resolve.alias` removed the default value `{ "@": "./src"}` provided by [alias](#alias).

If you need this feature, please use `resolve.alias` and avoid mixing it with [alias](#alias).
If you need this feature, please use `resolve.alias`.

In the next major version, `resolve.alias` will replace [alias](#alias).

:::warning
- Note that this configuration should not be mixed with [alias](#alias).
- Ensure that this configuration specifies a relative path, such as `{ "@": "./src" }` rather than `{ "@": "src"}`.

:::

### resolve.mainFields

A list of fields in package.json to try when parsing the package entry point.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,16 @@ import { createElement } from "./react-native";
我们想要修复这个问题,但是这可能会破坏已有的项目,因此我们在 MAJOR_VERSION.58.0 版本提供了 `resolve.alias` 来解决这个问题。
并且 `resolve.alias` 里移除了 [alias](#alias) 提供的默认值 `{ "@": "./src"}`

如果你需要此功能,请使用 `resolve.alias`, 注意不要与 [alias](#alias) 混用
如果你需要此功能,请使用 `resolve.alias`

在下一个大版本,`resolve.alias` 将会取代 `alias`

:::warning
- 注意此配置不要与 [alias](#alias) 混用。
- 注意此配置必须标注一个相对路径,例如 `{ "@": "./src" }` 而非 `{ "@": "src"}`

:::

### resolve.mainFields

package.json 中,在解析包的入口点时尝试的字段列表。
Expand Down

0 comments on commit 495d11c

Please sign in to comment.