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/packages/lynx-bundle-rslib-config/interfaces/ExternalBundleLibConfig.md.
Lynx
  • 简体中文
  • 接口: ExternalBundleLibConfig

    defineExternalBundleRslibConfig 接受的 Rslib 配置结构。

    继承

    • LibConfig

    属性

    autoExtension?

    optional autoExtension?: boolean

    是否根据 format 选项自动设置 JavaScript 输出文件的扩展名。

    默认值

    true

    参阅

    https://rslib.rs/config/lib/auto-extension

    继承自

    LibConfig.autoExtension


    autoExternal?

    optional autoExternal?: AutoExternal

    是否自动将不同依赖类型的依赖外部化,而不将它们打包进 bundle。

    已被弃用

    请改用 output.autoExternal。

    默认值

    当 format 为 cjs 或 esm 时为 true,当 format 为 umd 或 mf 时为 false。

    参阅

    https://rslib.rs/config/lib/auto-external

    继承自

    LibConfig.autoExternal


    optional banner?: BannerAndFooter

    向每个 JavaScript、CSS 或声明文件的顶部注入内容。

    默认值

    {}

    参阅

    https://rslib.rs/config/lib/banner

    继承自

    LibConfig.banner


    bundle?

    optional bundle?: boolean

    是否打包该库。

    默认值

    true

    参阅

    https://rslib.rs/config/lib/bundle

    继承自

    LibConfig.bundle


    dev?

    optional dev?: Pick<DevConfig, AllowedEnvironmentDevKeys>

    本地开发相关的选项。

    继承自

    LibConfig.dev


    dts?

    optional dts?: Dts

    配置 TypeScript 声明文件的生成。

    默认值

    false

    参阅

    https://rslib.rs/config/lib/dts

    继承自

    LibConfig.dts


    experiments?

    optional experiments?: LibExperiments

    实验性特性相关的选项。

    默认值

    {}

    参阅

    https://rslib.rs/config/lib/experiments

    继承自

    LibConfig.experiments


    externalHelpers?

    optional externalHelpers?: boolean

    是否从 @swc/helpers 导入 SWC 辅助函数,而不是将其内联。

    默认值

    false

    参阅

    https://rslib.rs/config/lib/external-helpers

    继承自

    LibConfig.externalHelpers


    optional footer?: BannerAndFooter

    向每个 JavaScript、CSS 或声明文件的底部注入内容。

    默认值

    {}

    参阅

    https://rslib.rs/config/lib/footer

    继承自

    LibConfig.footer


    format?

    optional format?: Format

    生成的 JavaScript 文件的输出格式。

    默认值

    'esm'

    参阅

    https://rslib.rs/config/lib/format

    继承自

    LibConfig.format


    html?

    optional html?: HtmlConfig

    HTML 生成相关的选项。

    继承自

    LibConfig.html


    id?

    optional id?: string

    该 library 的唯一标识符。

    默认值

    undefined

    参阅

    https://rslib.rs/config/lib/id

    继承自

    LibConfig.id


    moduleFederation?

    optional moduleFederation?: ModuleFederationConfig

    模块联邦相关的选项。

    继承自

    LibConfig.moduleFederation


    outBase?

    optional outBase?: string

    输出文件的基础目录。

    默认值

    undefined

    参阅

    https://rslib.rs/config/lib/out-base

    继承自

    LibConfig.outBase


    output?

    optional output?: OutputConfig

    继承文档

    重写了

    LibConfig.output


    performance?

    optional performance?: PerformanceConfig

    构建性能与运行时性能相关的选项。

    继承自

    LibConfig.performance


    plugins?

    optional plugins?: RsbuildPlugins

    配置 Rsbuild 插件。

    继承自

    LibConfig.plugins


    redirect?

    optional redirect?: Redirect

    配置导入路径的重定向,适用于 bundle 设置为 false 的情况。

    默认值

    {}

    参阅

    https://rslib.rs/config/lib/redirect

    继承自

    LibConfig.redirect


    resolve?

    optional resolve?: ResolveConfig

    模块解析相关的选项。

    继承自

    LibConfig.resolve


    security?

    optional security?: SecurityConfig

    Web 安全相关的选项。

    继承自

    LibConfig.security


    shims?

    optional shims?: Shims

    配置 CommonJS 和 ESM 输出的 shim。

    默认值

    const defaultShims = {
      cjs: {
        'import.meta.url': true,
        'import.meta.dirname': true,
        'import.meta.filename': true,
      },
      esm: {
        __filename: false,
        __dirname: false,
        require: false,
      },
    };

    参阅

    https://rslib.rs/config/lib/shims

    继承自

    LibConfig.shims


    source?

    optional source?: SourceConfig

    输入源代码相关的选项。

    继承自

    LibConfig.source


    splitChunks?

    optional splitChunks?: false | SplitChunksConfig

    chunk 拆分相关的选项。

    继承自

    LibConfig.splitChunks


    syntax?

    optional syntax?: Syntax

    配置 JavaScript 和 CSS 将被降级到的语法。

    默认值

    'esnext'

    参阅

    https://rslib.rs/config/lib/syntax

    继承自

    LibConfig.syntax


    tools?

    optional tools?: ToolsConfig

    底层工具相关的选项。

    继承自

    LibConfig.tools


    umdName?

    optional umdName?: LibraryName

    UMD bundle 的导出名称。

    默认值

    undefined

    参阅

    https://rslib.rs/config/lib/umd-name

    继承自

    LibConfig.umdName


    wasm?

    optional wasm?: Wasm

    配置 Rslib 如何处理 .wasm 模块。设为 false 时,ESM 的 .wasm 导入保持源码中的写法不变。

    该选项只有在 format 为 'esm' 时才能配置。

    默认值

    当 bundle 为 true 时为 { mode: 'compile' };当 bundle 为 false 时为 { mode: 'preserve' }。

    参阅

    https://rslib.rs/config/lib/wasm

    继承自

    LibConfig.wasm

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。