angular-architects / module-federation-plugin

MIT License
683 stars 184 forks source link

Native federation minimum JavaScript version (Error if < ES2020) #544

Open rgarciadelongoria opened 2 weeks ago

rgarciadelongoria commented 2 weeks ago

Hi, I have a microfront-end project with Native Federation and Angular 17.

If I try to load this project in a Chrome browser with version less than 93 or a mobile safari before iOS 16.4 (approximate versions), the project gives an error in the console indicating that the browser cannot understand the code.

Captura de pantalla 2024-04-26 a las 9 31 01

For this reason I have tried without success to lower the ES target or transpile the code after its generation to ES6 (ES2015) but I cannot solve the problem.

Using a browserlist configuration I can't get anything and if I modify the tsconfig.json configuration I encounter the problem that I indicate in the image. Dynamic imports only work from ES2020.

Captura de pantalla 2024-04-26 a las 9 25 41

And this greatly limits the end devices on which my project can work.

Has anyone found a solution? It seems like a major problem to me to rule out devices like an iPhone 8 that many people still use or an Android 10 that doesn't have Chrome updated, for example.

Thanks greetings!

manfredsteyer commented 1 week ago

Hi,

Can you please try this combination:

"target": "ES2015", "module": "ES2022"

Best wishes, Manfred