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/packages/rspeedy/interfaces/CreateRspeedyOptions.md.
Lynx
  • English
  • Interface: CreateRspeedyOptions

    The options of createRspeedy method.

    Properties

    callerName?

    optional callerName?: string

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

    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;
            });
          }
        }
      };
    }

    Default Value

    'rspeedy'

    cwd?

    optional cwd?: string

    The root path of the current build.


    environment?

    optional environment?: string[]

    Only build specified environments. For example, passing ['lynx'] will only build the lynx environment. If not specified or passing an empty array, all environments will be built.

    See

    https://rsbuild.rs/guide/advanced/environments#build-specified-environment

    Default Value

    []

    loadEnv?

    optional loadEnv?: boolean | LoadEnvOptions

    Rspeedy automatically loads the .env file by default, utilizing the Rsbuild API. You can use the environment variables defined in the .env file within your code by accessing them via import.meta.env.FOO or process.env.Foo.

    See

    https://rsbuild.rs/guide/advanced/env-vars#env-file

    Default Value

    true

    rspeedyConfig?

    optional rspeedyConfig?: Config

    The config of Rspeedy.

    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.