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/rsbuild-plugin/index.md.
Lynx
  • English
  • Module: @lynx-js/rsbuild-plugin

    npm · Source · Changelog

    The Lynx build engine as an Rsbuild plugin. It builds a Lynx app with the Rsbuild CLI directly, without the Rspeedy CLI.

    DSL plugins such as pluginReactLynx register the engine automatically when it is missing, so you only add pluginLynx yourself to pass the options below. Rspeedy registers it for you as well and forwards output.filename and performance.profile from lynx.config.ts.

    Example

    Register the plugin next to a DSL plugin in rsbuild.config.ts. The environment name (lynx below) becomes the [platform] placeholder of the bundle filename, so the default output of this config is dist/main.lynx.bundle.

    rsbuild.config.ts
    import { defineConfig } from '@rsbuild/core'
    import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
    import { pluginLynx } from '@lynx-js/rsbuild-plugin'
    
    export default defineConfig({
      source: {
        entry: { main: './src/index.tsx' },
      },
      environments: {
        lynx: {},
      },
      plugins: [
        pluginLynx({
          performance: { profile: false },
        }),
        pluginReactLynx(),
      ],
    })

    Then use the Rsbuild CLI:

    rsbuild dev
    rsbuild build

    Remarks

    To migrate from Rspeedy, replace rspeedy dev / rspeedy build with rsbuild dev / rsbuild build, rename lynx.config.ts to rsbuild.config.ts and import defineConfig from @rsbuild/core. The two options Rspeedy used to forward to the engine are now passed to pluginLynx directly:

    lynx.config.ts (Rspeedy)pluginLynx() (Rsbuild)
    output.filename as a stringoutput.filename.bundle
    output.filename.bundleoutput.filename.bundle
    output.filename.template (deprecated)output.filename.bundle
    performance.profileperformance.profile

    Everything else in output, source, dev and server keeps the Rsbuild shape and stays in rsbuild.config.ts. The engine applies Lynx-specific defaults on top of the Rsbuild ones (bundle target, chunk loading, CSS extraction, source maps) and only overrides a setting when another plugin has not already set it.

    Interfaces

    Type Aliases

    Variables

    Functions

    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.