web-infra-dev / rslib

Create JavaScript libraries in a simple and intuitive way.
https://lib.rsbuild.dev/
MIT License
398 stars 20 forks source link

[Feature]: Support for Module Federation #212

Closed chenjiahan closed 3 weeks ago

chenjiahan commented 1 month ago

What problem does this feature solve?

Allow Rslib to create Module Federation remote module.

What does the proposed API look like?

I have created a demo (https://github.com/chenjiahan/rslib-mf) to try out the ModuleFederationPlugin in Rslib, and I find that the format: 'esm' breaks the output of Module Federation, so Rslib should provide a new format for Module Federation, such as format: 'module-federation' or format: 'none'.

Timeless0911 commented 1 month ago

I prefer format: 'module-federation', since format: 'none' seems a bit ambiguous.