rspack-contrib / prebundle

Prebundle Node.js dependencies, output a single js file, a package.json file and the dts files.
MIT License
21 stars 5 forks source link

Feature Request: Automatic externals between prebundled packages #13

Closed xc2 closed 1 week ago

xc2 commented 2 weeks ago

For example,

If there're two deps defined in prebundle.config.mjs: package a and package b.

If resolving "b" in package a results in the same position of package b, we could add { b: '../b/index.js' } into a's externals.

If resolving "a" in package b results in the same position of package a, we could add { a: '../a/index.js' } into b's externals.

Todo

xc2 commented 1 week ago

We cannot do this at this time because:

Therefore, we need to manage externals using "resource path" instead of "request", but unfortunately, ncc does not support this.

xc2 commented 1 week ago

Close as it’s hard to do it correctly with ncc