Blocker runtime error if using webpack federation plugin
Expected Behaviour
ts-loader should work with webpack and the native plugin ModuleFederationPlugin.
Actual Behaviour
If ModuleFederationPlugin gets enabled a invalid bundle is generated and a runtime error breaks the loading of the source. Error: Uncaught Error: Shared module is not available for eager consumption
Steps to Reproduce the Problem
Create a simple project with webapack and ts-loader and ModuleFederationPlugin ( example bellow ).
Location of a Minimal Repository that Demonstrates the Issue.
If you comment the ts-loader config and uncomment babel it works just fine. It also works if we remove ModuleFederationPlugin.
https://github.com/levymoreira/ts-loader-federation-issue/blob/master/webpack.config.js#:~:text=//-,ts%2Dloader,-example%2C%20only%20works
We haven't done any work to actively support the ModuleFederationPlugin. It's possible some would be necessary to get it working. If you'd like to take a look we'd certainly look at a PR.
@levymoreira problem is with your typescript configuration. You need to change module code generation to "ESNext" instead of "commonjs".
https://github.com/levymoreira/ts-loader-federation-issue/blob/649eb8ed3a79628d8ee62dc85aeb1a0d34afe753/tsconfig.json#L8
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.