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