We have implemented module federation with nx. In a poc project we created a shell and a remote project with all default settings with angular 18.0.3 ( in the poc 18.0.2) and ng/angular 19.1.2
In the poc project when we build the project it works fine, but if we copy the same projects and settings in an existing project the module federation doesn’t work. And different files are created. We don’t get any error when we build and run the project.’
In our main project these files are created on build:
- default-node_modules_angular_common_fesm2022_common_mjs.js
- default-node_modules_angular_common_fesm2022_http_mjs.js
- node_modules_angular_router_fesm2022_router_mjs.js
- common.js
In the poc project these files are generated on build:
- default-node_modules_angular_common_fesm2022_common_mjs.js
- default-node_modules_angular_common_fesm2022_http_mjs.js
- default-node_modules_angular_platform-browser_fesm2022_platform-browser_mjs.js
- default-node_modules_angular_router_fesm2022_router_mjs.js
We have reset the nx cache before building and we have the same nx.json settings and same tsconfig.base.json settings ( only difference is that we have more paths to files in our main project )
Can anybody explain how does this is possible:
see screencapture of build directories