For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/rspeedy/rspeedy.source.assetsinclude.md.
Rspeedy logo
Rspeedy
  • 简体中文
  • Home > @lynx-js/rspeedy > Source > assetsInclude

    Source.assetsInclude property

    Include additional files that should be treated as static assets.

    Signature:

    assetsInclude?: Rspack.RuleSetCondition | undefined;

    Default Value

    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 许可协议进行许可。