source.transformImport

Transform the import path, which can be used to modularly import the subpath of third-party packages. The functionality is similar to babel-plugin-import

  • Type:
type TransformImport =
  | false
  | Array<{
      libraryName: string;
      libraryDirectory?: string;
      style?: string | boolean;
      styleLibraryDirectory?: string;
      camelToDashComponentName?: boolean;
      transformToDefaultImport?: boolean;
      customName?: string;
      customStyleName?: string;
    }>
  | Function;
  • Default: undefined
Info

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