-
-
Notifications
You must be signed in to change notification settings - Fork 53
How to implement noExternal configuration similar to tsup #433
-
如何实现类似tsup的noExternal配置,用来将某个外部依赖与库一起打包?
在现有的配置中找不到相关的配置,autoExternal好象不是干这活的
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 3 replies
-
一般来说,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?
Beta Was this translation helpful? Give feedback.
All reactions
-
意思是如果要打包就放在autoExternal.dep,否则放autoExternal.peepDep?
文档没说明
Beta Was this translation helpful? Give feedback.
All reactions
-
- https://lib.rsbuild.dev/guide/advanced/third-party-deps
- https://lib.rsbuild.dev/config/lib/auto-external
If you want to bundle a dependency, just specify it in devDependencies in package.json. Both of these two documents clearly state it.
Beta Was this translation helpful? Give feedback.
All reactions
-
@fi3ework 我这边有场景,我有一个包有多个 exports,但是我想要打包其中一部分导出,另外一部分导出不打包,这时候就需要 noExternal
举个例子,包 A 都多个 exports:A/B 和 A/C
我想要打包 A/B,但是 A/C 依旧作为 external 处理
Beta Was this translation helpful? Give feedback.
All reactions
-
You can configure output.externals.
Beta Was this translation helpful? Give feedback.