Home > @lynx-js/rspeedy > Source > assetsInclude

Source.assetsInclude property

Include additional files that should be treated as static assets. Defaults to be undefined.

Signature:

assetsInclude?: Rspack.RuleSetCondition | undefined;

Remarks

By default, Rsbuild treats common image, font, audio, and video files as static assets. Through the source.assetsInclude config, you can specify additional file types that should be treated as static assets. These added static assets are processed using the same rules as the built-in supported static assets。

The usage of source.assetsInclude is consistent with Condition in Rspack, which supports passing in strings, regular expressions, arrays of conditions, or logical conditions to match the module path or assets.

Example

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  source: {
    assetsInclude: /\.json5$/,
  },
})
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.