For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/rspeedy/rspeedy.createrspeedyoptions.callername.md.
Rspeedy logo
Rspeedy
  • English
  • 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;
            });
          }
        }
      };
    }
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.