For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/configure/app/source/transform-import.md.
  • 简体中文
  • source.transformImport

    转换 import 的路径,可以用于模块化引用三方包的子路径,能力类似于 babel-plugin-import。

    • 类型:
    type TransformImport =
      | false
      | Array<{
          libraryName: string;
          libraryDirectory?: string;
          style?: string | boolean;
          styleLibraryDirectory?: string;
          camelToDashComponentName?: boolean;
          transformToDefaultImport?: boolean;
          customName?: string;
          customStyleName?: string;
        }>
      | Function;
    • 默认值: undefined
    Info

    该配置项的使用方式与 Rsbuild 完全一致。详细信息请参考 Rsbuild - source.transformImport。