Replies: 1 comment
-
Disabling default chunk group, like below gives the expected JavaScript, but I see chunks are loaded from MFE again, when its already loaded by shell
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to use ModuleFederationPlugin in an Angular project, I am able to get this working following the documentation available. What I am trying now to is to use chunk grouping configuration, like the example below
module.exports = { // ... optimization: { splitChunks: { cacheGroups: { angular: { name: 'angular', test: /[\\\/]node_modules[\\\/]@angular[\\\/]/, chunks: 'all', priority: 10, enforce: true, }, }, }, }, };
Build goes fine and generates chunk files based on the grouping configuration, but when I look at MFE initial chunk, I see it still refers/depends on chunks ignoring the chunk grouping configuration. For example initial chunk of MFE has below code where it has references to chunks and also grouped chunks .
register("@angular/animations/browser", "15.2.5", () => (Promise.all([__webpack_require__.e("angular"), __webpack_require__.e("default-webpack_sharing_consume_default_angular_core_angular_core"), __webpack_require__.e("default-webpack_sharing_consume_default_angular_animations_angular_animations")]).then(() => (() => (__webpack_require__(/*! ./node_modules/@angular/animations/fesm2020/browser.mjs */ 72753))))));
Where as I expect it to be something like below
register("@angular/animations/browser", "15.2.5", () => (Promise.all([__webpack_require__.e("angular")]).then(() => (() => (__webpack_require__(/*! ./node_modules/@angular/animations/fesm2020/browser.mjs */ 72753))))));
Is there something I miss ? any reference that I can go through to try a solution ?
Thank you,
Rakesh.A
Beta Was this translation helpful? Give feedback.
All reactions