I am using Webpack’s Module Federation feature in an Angular project. I have properly made all the necessary setup in custom-webpack.config.js for Module Federation. However, I am running into an issue: Angular doesn’t automatically import the remoteEntry.js file.
From what I understand, Module Federation uses static import, which means that remoteEntry.js should be directly referenced in my Angular application. But in my case, it looks like Angular does not automatically load this file. I have read that this can be solved by manually including the script file in the index.html or by using Webpack’s dynamic public path feature. However, each method comes with its own drawbacks.
I am looking for a way to automatically import this file in Angular. Why doesn’t Angular support this out of the box? Has anyone faced this issue before or have any ideas of how to solve this?
Thanks in advance.
I succeeded by dynamically importing remoteEntry.js in the body in app.module.ts, but
I wonder why angular doesn’t support this
baek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.