module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

Dynamically loading remoteEntry

Open Cybbin opened this issue 2 years ago • 1 comments

Now i have only one container app and having the following configuration:

new ModuleFederationPlugin({
  name: "container",
  filename: "remoteEntry.js",
  exposes: {
    "./utils": "./src/utils.js",
  },
  shared: {
    vue: { singleton: true },
  },
}),

I want to dynamically loading remoteEntry.js file, but it seems to directly inserted into the HTML.

image

I want to control the cache through timestamp(?v=[Date.now]), how can i do?

Cybbin avatar Dec 06 '23 03:12 Cybbin

Looks like you need to look the configuration of the HTMLWebpackPlugin to see how it's generating your HTML. In that configuration you might be able to specify a timestamp as query param...

fcano-ut avatar Dec 21 '23 16:12 fcano-ut

look at runtime-plugins folder in here, you can write runtime plugin to do stuff like that. look at module-federation/enhanced

ScriptedAlchemy avatar Mar 05 '24 07:03 ScriptedAlchemy