-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache invalidation with @module-federation/enhanced #2488
Comments
You would use a runtimePlugin https://module-federation.io/plugin/dev/index.html in the args.options.remotes. = args.options.remotes.map((remote)=>{
remote.entry = remote.entry + '?' + Date.now()
}) |
Great, thanks I ended up creating a separate file for it:
and then used it in runtimePlugins option:
I'm using |
Init is better imo as you want to change this script source as the system starts. Think about if other runtime plugins are used in the future. Init is the best place personally. But before request can do it, it'll just be during runtime which could be problematic if you have some other plugins who attempt to read configs during init. Both will work but my preference is init hook. |
You can also register a global plugin if you want this to apply to the entire system. I can show you sample of global plugin but use them wisely if you do as they will impact everyone with no option to opt out |
That will be interesting to see, could you please share it here |
core/packages/runtime/src/global.ts Line 289 in b3530d7
import {registerGlobalPlugin} from mfruntime |
Describe the bug
Hi team,
I'm encountering an issue with remote entries consistently being the same every time I try to consume them using the following setup:
Previously, we relied on the
ExternalTemplateRemotesPlugin
package before transitioning to@module-federation/enhanced
, and it effectively generated date timestamps, ensuring the creation of new remote entries each time. Is there a similar approach available in the new enhanced package? I noticed some changes in the nextjsmf package here, but I'm uncertain if there's a direct equivalent in the enhanced package.Reproduction
NA
Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: