For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/build/environments.md.
Lynx
  • 简体中文
  • environments

    optional environments?: Record<string, EnvironmentConfig>

    Lynx 默认值覆盖

    此项是 Rsbuild 配置,pluginLynx 覆盖了它的默认值。下方默认值指应用插件后的值。请在 rsbuild.config.ts 顶层配置,显式设置的值优先。

    完整行为见 Rsbuild 配置参考。

    Config.environments 选项用于设置输出的 environment。

    默认值

    未设置该选项时,Rspeedy 会向 Rsbuild 传入 { lynx: {} }。

    备注

    如果你没有使用 Lynx for Web,通常不需要此选项。

    示例

    • 为 Lynx 和 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',
      },
    })
    • 仅构建 Web 产物。
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      environments: {
        web: {
          source: { entry: { web: './src/index.web.jsx' } },
        },
      },
    })
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。