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
2 changes: 1 addition & 1 deletion website/docs/en/config/rsbuild/resolve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Control the priority between the `paths` option in `tsconfig.json` and the `reso

## resolve.alias <RsbuildDocBadge path="/config/resolve/alias" text="resolve.alias" />

Create aliases to import or require certain modules, same as the [resolve.alias](https://rspack.dev/config/resolve#resolvealias) config of Rspack.
Set the alias for the module path, which is used to simplify the import path or redirect the module reference, similar to the [resolve.alias](https://rspack.dev/config/resolve#resolvealias) config of Rspack.

For TypeScript projects, you only need to configure [compilerOptions.paths](https://www.typescriptlang.org/tsconfig/#paths) in the `tsconfig.json` file. Rslib will automatically recognize it, so there is no need to configure the `resolve.alias` option separately.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/config/rsbuild/resolve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { RsbuildDocBadge } from '@components/RsbuildDocBadge';

## resolve.alias <RsbuildDocBadge path="/config/resolve/alias" text="resolve.alias" />

设置文件引用的别名,对应 Rspack 的 [resolve.alias](https://rspack.dev/zh/config/resolve#resolvealias) 配置。
设置模块路径的别名,用于简化导入路径或重定向模块引用,类似于 Rspack 的 [resolve.alias](https://rspack.dev/zh/config/resolve#resolvealias) 配置。

对于 TypeScript 项目,你只需要在 `tsconfig.json` 中配置 [compilerOptions.paths](https://www.typescriptlang.org/tsconfig/#paths) 即可,Rslib 会自动识别它,不需要额外配置 `resolve.alias` 字段。

Expand Down
Loading