Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to implement noExternal configuration similar to tsup #433

Unanswered
zhangfisher asked this question in Q&A
Discussion options

如何实现类似tsupnoExternal配置,用来将某个外部依赖与库一起打包?

在现有的配置中找不到相关的配置,autoExternal好象不是干这活的

You must be logged in to vote

Replies: 2 comments 3 replies

Comment options

一般来说,autoExternal 已经足够应对大多数场景了,如果你不想打包某个库,可以直接将它放进 peerDep 或者 dep 即可达到目的 https://lib.rsbuild.dev/config/lib/auto-external 现在有遇到 autoExternal 无法满足的场景吗?

Generally speaking, autoExternal is enough to handle most scenarios. If you don't want to bundle a library, you can directly put it into peerDep or dep to achieve the purpose https://lib.rsbuild.dev/config/lib/auto-external. Are there any scenarios that autoExternal can't satisfy now?

You must be logged in to vote
2 replies
Comment options

意思是如果要打包就放在autoExternal.dep,否则放autoExternal.peepDep?

文档没说明

Comment options

If you want to bundle a dependency, just specify it in devDependencies in package.json. Both of these two documents clearly state it.

Comment options

@fi3ework 我这边有场景,我有一个包有多个 exports,但是我想要打包其中一部分导出,另外一部分导出不打包,这时候就需要 noExternal

举个例子,包 A 都多个 exports:A/B 和 A/C
我想要打包 A/B,但是 A/C 依旧作为 external 处理

You must be logged in to vote
1 reply
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /