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.

tools.rspack merges the configuration arrays based on webpack-merge, which means tools.rspack.resolve.conditionNames will merge with the default value of Rsbuild, rather than overriding it.