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

    Beta

    The Lynx config that pluginLynx exposes to other plugins.

    Remarks

    The data mirrors LynxPluginOptions, so a plugin reads config.output.filename the same way it reads output.filename from api.getRsbuildConfig(). Values that depend on the entry being built are derived by the methods, which travel with the data so that the plugin that built the config is always the one that resolves it.

    Example

    const lynx = getLynxConfig(api)
    const filename = lynx.resolveBundleFilename({
      entryName: 'main',
      platform: environment.name,
    })

    Properties

    output

    readonly output: LynxOutput

    Beta

    The build outputs.


    performance

    readonly performance: LynxPerformance

    Beta

    The performance options.

    Methods

    resolveBundleFilename()

    resolveBundleFilename(context: object): string

    Beta

    Resolve the name of the bundle file of an entry.

    Parameters

    ParameterTypeDescription
    context{ entryName: string; platform: string; }The entry to resolve the name for.
    context.entryNamestring-
    context.platformstring-

    Returns

    string


    resolveIntermediateDir()

    resolveIntermediateDir(context?: object): string

    Beta

    Resolve the directory of the intermediate files.

    Parameters

    ParameterTypeDescription
    context?{ entryName?: string; }The entry to resolve the directory for. Without an entry name, the directory that holds every entry's is returned.
    context.entryName?string-

    Returns

    string

    Remarks

    A Lynx bundle is encoded from per-thread JS, CSS and HMR outputs. They are emitted into this directory, per entry, instead of next to the bundle.


    resolveLazyBundleFilename()

    resolveLazyBundleFilename(context: object): string | undefined

    Beta

    Resolve the name of the lazy bundle files.

    Parameters

    ParameterTypeDescription
    context{ platform: string; }The environment to resolve the name for.
    context.platformstring-

    Returns

    string | undefined

    The resolved name, or undefined when LynxFilename.bundle is not a function. A lazy bundle name can only be customized by a function, since it is resolved per async chunk, so undefined means the caller leaves the name to LynxTemplatePlugin.

    Remarks

    There is no entry name to resolve [name] with, so the placeholder is kept for LynxTemplatePlugin to fill in per async chunk.

    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.