source.alias

  • Type:
type Alias = Record<string, string | false | (string | false)[]> | Function;
  • Default: undefined

Create aliases to import or require certain modules, same as the resolve.alias config of Rspack.

TIP

For TypeScript projects, you only need to configure compilerOptions.paths in the tsconfig.json file. The Rsbuild will automatically recognize it, so there is no need to configure the source.alias option separately. For more details, please refer to Path Aliases.

INFO

The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to Rsbuild - source.alias.