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

    The names of the files emitted by the Lynx build engine.

    Properties

    bundle?

    optional bundle?: BundleFilename

    The name of the bundle files.

    Default Value

    '[name].[platform].bundle'

    Remarks

    The following placeholders are supported:

    • [name]: the name of the entry.
    • [platform]: the name of the Rsbuild environment.
    • [contenthash]: the hash of the bundle content.

    Examples

    • Using content hash with length in bundle filename:
    import { defineConfig } from '@rsbuild/core'
    import { pluginLynx } from '@lynx-js/rsbuild-plugin'
    
    export default defineConfig({
      plugins: [
        pluginLynx({
          output: {
            filename: {
              bundle: '[name].[contenthash:8].bundle',
            },
          },
        }),
      ],
    })
    • Using a function to control the main bundle and the lazy bundles separately (e.g. emit lazy bundles into another directory with a git commit hash appended):
    import { execSync } from 'node:child_process'
    
    import { defineConfig } from '@rsbuild/core'
    import { pluginLynx } from '@lynx-js/rsbuild-plugin'
    
    const gitHash = execSync('git rev-parse --short HEAD').toString().trim()
    
    export default defineConfig({
      plugins: [
        pluginLynx({
          output: {
            filename: {
              bundle: ({ lazyBundle, platform }) =>
                lazyBundle
                  ? `my-lazy-bundles/[name].[fullhash]-${gitHash}.bundle`
                  : `[name].${platform}.bundle`,
            },
          },
        }),
      ],
    })
    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.