For AI agents: the complete documentation index is available at https://rsdoctor.rs/zh/llms.txt, the full documentation bundle is available at https://rsdoctor.rs/zh/llms-full.txt, and this page is available as Markdown at https://rsdoctor.rs/zh/config/options/multiCompiler.md.
close
  • 简体中文
  • multiCompiler

    • 类型: boolean | { group?: string; ignoreChildCompilers?: string[] }
    • 默认值: true

    RsdoctorRspackPlugin 默认会自动识别同一次启动中的多个 compiler,为每个 compiler 创建独立的分析数据,并在报告中提供 compiler 切换入口。Rsbuild 的 environments 会直接使用 environment 名称,例如 web、node。

    默认 compiler 仍输出到原有的 .rsdoctor 目录,其他 compiler 输出到 .rsdoctor/compilers/<compilerName>。

    如果同一进程会同时创建多个互不相关的 compiler,可以设置为 false 来关闭跨插件实例的自动聚合,同时关闭子编译器跟踪。也可以提供 group,显式指定需要聚合的插件实例:

    new RsdoctorRspackPlugin({
      multiCompiler: { group: 'ssr' },
    });

    通过 ignoreChildCompilers 按名称跳过子编译器报告。配置项会与子编译器自身名称及父编译器传入的名称精确匹配。Rsdoctor 默认已跳过 HtmlRspackCompiler 和 mini-css-extract-plugin。

    new RsdoctorRspackPlugin({
      multiCompiler: {
        ignoreChildCompilers: ['vanilla-extract-compiler'],
      },
    });