You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using module federation and were hoping we could use both eager: true and singleton: true for each shared module in our shared config. We wanted to use eager: true so that the load of our host app would be faster since we know we'll need these modules in our host app right away. We wanted to use singleton: true so that only one instance each of the shared modules is loaded.
However, it appears that when both eager: true and singleton: true are set, that singleton: true gets ignored and multiple instances of a shared module are loaded (one from the host and one from the remote) if their semver ranges don't overlap.
Does anyone know if this behavior is intentional? Is using eager: true and singleton: true an anti-pattern?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We're using module federation and were hoping we could use both
eager: true
andsingleton: true
for each shared module in ourshared
config. We wanted to useeager: true
so that the load of our host app would be faster since we know we'll need these modules in our host app right away. We wanted to usesingleton: true
so that only one instance each of the shared modules is loaded.However, it appears that when both
eager: true
andsingleton: true
are set, thatsingleton: true
gets ignored and multiple instances of a shared module are loaded (one from the host and one from the remote) if their semver ranges don't overlap.Does anyone know if this behavior is intentional? Is using
eager: true
andsingleton: true
an anti-pattern?Beta Was this translation helpful? Give feedback.
All reactions