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/build/environments.md.
Lynx
  • English
  • environments

    optional environments?: Record<string, EnvironmentConfig>

    Lynx default override

    This is an Rsbuild option whose default is overridden by pluginLynx. The default shown below applies when using the plugin. Set this option at the top level of rsbuild.config.ts; an explicit value takes precedence.

    See the Rsbuild reference for the full option behavior.

    The Config.environments option is used to set the output environment.

    Default Value

    When this option is unset, Rspeedy passes { lynx: {} } to Rsbuild.

    Remarks

    Normally you don't need this if you are not using Lynx for Web.

    Examples

    • Using different entries for Lynx and Web.
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      environments: {
        lynx: {},
        web: {
          source: { entry: { web: './src/index.web.jsx' } },
        },
      },
      source: {
        entry: './src/index.jsx',
      },
    })
    • Building Web-only outputs.
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      environments: {
        web: {
          source: { entry: { web: './src/index.web.jsx' } },
        },
      },
    })
    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.