接口: ExternalBundleLibConfig
defineExternalBundleRslibConfig 接受的 Rslib 配置结构。
继承
LibConfig
属性
autoExtension?
optionalautoExtension?:boolean
是否根据 format 选项自动设置 JavaScript 输出文件的扩展名。
默认值
true
参阅
https://rslib.rs/config/lib/auto-extension
继承自
LibConfig.autoExtension
autoExternal?
optionalautoExternal?:AutoExternal
是否自动将不同依赖类型的依赖外部化,而不将它们打包进 bundle。
已被弃用
请改用 output.autoExternal。
默认值
当 format 为 cjs 或 esm 时为 true,当 format 为 umd 或 mf 时为 false。
参阅
https://rslib.rs/config/lib/auto-external
继承自
LibConfig.autoExternal
banner?
optionalbanner?:BannerAndFooter
向每个 JavaScript、CSS 或声明文件的顶部注入内容。
默认值
{}
参阅
https://rslib.rs/config/lib/banner
继承自
LibConfig.banner
bundle?
optionalbundle?:boolean
是否打包该库。
默认值
true
参阅
https://rslib.rs/config/lib/bundle
继承自
LibConfig.bundle
dev?
optionaldev?:Pick<DevConfig,AllowedEnvironmentDevKeys>
本地开发相关的选项。
继承自
LibConfig.dev
dts?
optionaldts?:Dts
配置 TypeScript 声明文件的生成。
默认值
false
参阅
https://rslib.rs/config/lib/dts
继承自
LibConfig.dts
experiments?
optionalexperiments?:LibExperiments
实验性特性相关的选项。
默认值
{}
参阅
https://rslib.rs/config/lib/experiments
继承自
LibConfig.experiments
externalHelpers?
optionalexternalHelpers?:boolean
是否从 @swc/helpers 导入 SWC 辅助函数,而不是将其内联。
默认值
false
参阅
https://rslib.rs/config/lib/external-helpers
继承自
LibConfig.externalHelpers
footer?
optionalfooter?:BannerAndFooter
向每个 JavaScript、CSS 或声明文件的底部注入内容。
默认值
{}
参阅
https://rslib.rs/config/lib/footer
继承自
LibConfig.footer
format?
optionalformat?:Format
生成的 JavaScript 文件的输出格式。
默认值
'esm'
参阅
https://rslib.rs/config/lib/format
继承自
LibConfig.format
html?
optionalhtml?:HtmlConfig
HTML 生成相关的选项。
继承自
LibConfig.html
id?
optionalid?:string
该 library 的唯一标识符。
默认值
undefined
参阅
https://rslib.rs/config/lib/id
继承自
LibConfig.id
moduleFederation?
optionalmoduleFederation?:ModuleFederationConfig
模块联邦相关的选项。
继承自
LibConfig.moduleFederation
outBase?
optionaloutBase?:string
输出文件的基础目录。
默认值
undefined
参阅
https://rslib.rs/config/lib/out-base
继承自
LibConfig.outBase
output?
optionaloutput?:OutputConfig
继承文档
重写了
LibConfig.output
performance?
optionalperformance?:PerformanceConfig
构建性能与运行时性能相关的选项。
继承自
LibConfig.performance
plugins?
optionalplugins?:RsbuildPlugins
配置 Rsbuild 插件。
继承自
LibConfig.plugins
redirect?
optionalredirect?:Redirect
配置导入路径的重定向,适用于 bundle 设置为 false 的情况。
默认值
{}
参阅
https://rslib.rs/config/lib/redirect
继承自
LibConfig.redirect
resolve?
optionalresolve?:ResolveConfig
模块解析相关的选项。
继承自
LibConfig.resolve
security?
optionalsecurity?:SecurityConfig
Web 安全相关的选项。
继承自
LibConfig.security
shims?
optionalshims?:Shims
配置 CommonJS 和 ESM 输出的 shim。
默认值
参阅
https://rslib.rs/config/lib/shims
继承自
LibConfig.shims
source?
optionalsource?:SourceConfig
输入源代码相关的选项。
继承自
LibConfig.source
splitChunks?
optionalsplitChunks?:false|SplitChunksConfig
chunk 拆分相关的选项。
继承自
LibConfig.splitChunks
syntax?
optionalsyntax?:Syntax
配置 JavaScript 和 CSS 将被降级到的语法。
默认值
'esnext'
参阅
https://rslib.rs/config/lib/syntax
继承自
LibConfig.syntax
tools?
optionaltools?:ToolsConfig
底层工具相关的选项。
继承自
LibConfig.tools
umdName?
optionalumdName?:LibraryName
UMD bundle 的导出名称。
默认值
undefined
参阅
https://rslib.rs/config/lib/umd-name
继承自
LibConfig.umdName
wasm?
optionalwasm?:Wasm
配置 Rslib 如何处理 .wasm 模块。设为 false 时,ESM 的 .wasm 导入保持源码中的写法不变。
该选项只有在 format 为 'esm' 时才能配置。
默认值
当 bundle 为 true 时为 { mode: 'compile' };当 bundle 为 false 时为 { mode: 'preserve' }。
参阅
https://rslib.rs/config/lib/wasm
继承自
LibConfig.wasm