Replies: 6 comments 1 reply
-
My problem is also partially related to angular/angular-cli#23008 but even if I patch "node_modules@angular-devkit\build-angular\src\utils\process-bundle.js" and change sourceType from "script" to "unambiguous" and successfully build the projects. I'm still getting the error: |
Beta Was this translation helpful? Give feedback.
-
I have a existing Monorepo and im converting it to use module federation and im also receiving the first error from the screenshot when placing |
Beta Was this translation helpful? Give feedback.
-
For now I'm using this workaround. Still looking for a better solution
(*) ֿI`m use it with NX v14.1.5 - on v14.6.4 Irrelevant
(*) change Disable extract license on prod mode or exclude workspace package:
|
Beta Was this translation helpful? Give feedback.
-
I have register issue regarding Also, it there are issues using |
Beta Was this translation helpful? Give feedback.
-
With Nx 15.5 and Angular 15 // module-federation.config.js
module.exports = {
// …
shared: (libraryName, libraryOptions) => {
switch (libraryName) {
case '@angular/localize':
return {
...libraryOptions,
eager: true,
import: '@angular/localize',
};
case '@angular/localize/init':
return {
...libraryOptions,
eager: true,
import: '@angular/localize/init',
};
default:
return libraryOptions;
}
},
}; in one app and // module-federation.config.js
module.exports = {
// …
shared: (libraryName, libraryOptions) => {
switch (libraryName) {
case '@angular/localize/init':
return {
...libraryOptions,
eager: true,
import: '@angular/localize',
};
default:
return libraryOptions;
}
},
}; in another |
Beta Was this translation helpful? Give feedback.
-
I came up with a workaround. '@angular/localize/init' and '@angular/localize' should not be shared.
The libraries used in polyfills should not be used in the runtime and this is the reason they should be skipped from sharing. The downside of this solution is that you can't serve the application with localize set to false. It should be explicitly set to a language.
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
I'm building the angular app using different locale ids. I'm struggling with setting up localized builds and module federation e.g.: I would like to use en source locale instead of default en-US and I would like to build different versions of the app (en, fr, de, pl etc.)
Is is possible to use module federation with localized builds ?
Please see repo with config that fails: https://github.com/dkornel/nx-mf-and-i18n-builds
Beta Was this translation helpful? Give feedback.
All reactions