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/output/data-uri-limit.md.
Lynx
  • English
  • output.dataUriLimit

    optional dataUriLimit?: number | DataUriLimit

    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 Output.dataUriLimit option is used to set the size threshold to inline static assets such as images and fonts.

    Default Value

    2048

    Examples

    Inline all static assets less than 4kB:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      output: {
        dataUriLimit: 4 * 1024,
      },
    })

    Disable inlining of static assets:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      output: {
        dataUriLimit: 0,
      },
    })

    Inline all static assets:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      output: {
        dataUriLimit: Number.MAX_SAFE_INTEGER,
      },
    })

    Disable inlining of all media but not images.

    lynx.config.ts
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        dataUriLimit: {
          image: 5000,
          media: 0,
        },
      },
    })
    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.