manfredsteyer / module-federation-plugin-example

258 stars 177 forks source link

Question: Reload the module if there is some change without refreshing the window #48

Open chethan1095 opened 3 months ago

chethan1095 commented 3 months ago

Hi, I need to reload the application module without refreshing the page. For Ex. If I run all the application at first and later when I stopped any one of the application and when I redirect to that path its should show module not found which I am getting only if I refresh the page I need the page to get updated without refreshing the window.

const module = await loadRemoteModule({
          remoteEntry: 'http://localhost:4205/remoteEntry.js',
          remoteName: 'encrypt',
          exposedModule: './Module'
        });

// Trigger initialization of federated module when the route is navigated to

      initFederation('/assets/mf.manifest.json')
        .catch(err => console.error(err))
        .then(_res => {
          console.log(_res);              
          import('../bootstrap')
        })

.catch(err => console.error(err)); I tried with loading remote module and also initFederation when route is navigated but its not updating