core
core copied to clipboard
fix(rsbuild-plugin): support other output formats
Description
This pull request includes several changes to the @module-federation/rsbuild-plugin and configuration files to enhance functionality and improve plugin behavior. The most important changes include the addition of a new option to force Module Federation on all formats, adjustments to chunk loading settings, and updates to configuration files to include the rsbuild-plugin package.
Enhancements to @module-federation/rsbuild-plugin:
- Added
forceMfOnAllFormatsoption toModuleFederationOptionsto allow overriding the default format check and enable Module Federation on all formats (packages/rsbuild-plugin/src/cli/index.ts). - Updated
pluginModuleFederationfunction to respect theforceMfOnAllFormatsoption and prevent settingchunkLoadingtojsonpwhenchunkFormatismodule(packages/rsbuild-plugin/src/cli/index.ts). [1] [2] [3] [4]
Configuration file updates:
- Added
.changesetentries to document the newforceMfOnAllFormatsoption and the change in chunk loading behavior (.changeset/breezy-tools-serve.md,.changeset/lovely-waves-draw.md). [1] [2] - Updated
.cursorignoreto include thersbuild-pluginpackage and its contents (.cursorignore). [1] [2]
Resolved runtime errors when chunk format is esm module
Related Issue
https://github.com/module-federation/module-federation-examples/pull/4342
Types of changes
- [ ] Docs change / refactoring / dependency upgrade
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
Checklist
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] I have updated the documentation.