For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/config/output/emit-assets.md.
close
  • 简体中文
  • output.emitAssets

    • 类型: boolean
    • 默认值: true

    用于控制是否输出图片、字体、媒体和其他类型文件等静态资源。

    在 SSR 等场景下,你可能不需要输出重复的静态资源,因此你可以将 emitAssets 设置为 false 来避免资源输出。

    示例

    比如,以下例子会在构建 web 产物时输出静态资源,而在构建 node 产物时避免输出。

    rsbuild.config.ts
    export default {
      environments: {
        web: {
          output: {
            target: 'web',
          },
        },
        node: {
          output: {
            target: 'node',
            emitAssets: false,
          },
        },
      },
    };