For AI agents: the complete documentation index is available at https://rsbuild.rs/llms.txt, the full documentation bundle is available at https://rsbuild.rs/llms-full.txt, and this page is available as Markdown at https://rsbuild.rs/config/resolve/condition-names.md.
close

resolve.conditionNames

Specifies the condition names used to match entry points in the exports field of a package.

Example

The value of resolve.conditionNames overrides the default value of Rsbuild:

rsbuild.config.ts
export default {
  resolve: {
    conditionNames: ['require', 'node'],
  },
};

Rspack config

resolve.conditionNames is provided by Rspack, see Rspack - resolve.conditionNames.

You can also configure it using tools.rspack:

rsbuild.config.ts
export default {
  tools: {
    rspack: {
      resolve: {
        conditionNames: ['custom'],
      },
    },
  },
};

The difference between them is how the configuration is merged.

resolve.conditionNames replaces existing arrays when merging Rsbuild configurations, while tools.rspack.resolve.conditionNames merges with explicitly configured values. This does not include Rspack's defaults, which are applied later during initialization.