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$/,
  },
})
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。