Home > @lynx-js/rspeedy > Output > dataUriLimit

Output.dataUriLimit property

The Output.dataUriLimit option is used to set the size threshold to inline static assets such as images and fonts.

Signature:

dataUriLimit?: number | undefined;

Remarks

The default value of dataUriLimit is 2kB.

Example 1

Inline all static assets less than 4kB:

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

Example 2

Disable inlining of static assets:

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

Example 3

Inline all static assets:

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    dataUriLimit: Number.MAX_SAFE_INTEGER,
  },
})
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.