For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/rspeedy.createrspeedyoptions.callername.md.
This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/rspeedy > CreateRspeedyOptions > callerName

CreateRspeedyOptions.callerName property

The name of the framework or tool that is currently invoking Rsbuild. This allows plugins to tailor their behavior based on the calling context.

Signature:

callerName?: string;

Default Value

'rspeedy'

Example

Rsbuild plugins can access this value via api.context.callerName.

export function myPlugin() {
  return {
    name: 'my-plugin',
    setup(api) {
      // Log the name of the tool invoking Rsbuild
      console.log(`Called by: ${api.context.callerName}`);

      // Conditionally apply plugin logic based on caller
      if (api.context.callerName === 'rspeedy') {
        api.modifyRsbuildConfig((config) => {
          // Apply rspeedy-specific config changes
          return config;
        });
      } else if (api.context.callerName === 'rslib') {
        api.modifyRsbuildConfig((config) => {
          // Apply rslib-specific config changes
          return config;
        });
      }
    }
  };
}