manfredsteyer / multi-framework-micro-frontend

76 stars 36 forks source link

Base-href in MFE doesn't work fine in shell-mode #13

Open kamyarfinlex opened 1 year ago

kamyarfinlex commented 1 year ago

If you configure a base-Href in the micro front-end angular application like MFE2.

'http://localhost.com/mfe2-standalone-mode' and 'http://localhost.com/mfe2' for shell mode

it is working but after navigation, there is an issue, the URL changed to the standalone automatically and if someone presses F5 then the shell-app will be gone.

I've found that there is router navigation like the following in MFE app.component.ts that doesn't cover all use cases like I mentioned in this issue.

this.router.navigateByUrl(url); window.addEventListener('popstate', () => { this.router.navigateByUrl(url); });

I would appreciate it if you can share some solutions or information in the case of having baseHref in MFE(s).