angular-architects / module-federation-plugin

MIT License
713 stars 191 forks source link

Shell and Remote in same App #337

Open cmd-kevin opened 1 year ago

cmd-kevin commented 1 year ago

Can an application act as a shell and remote and call itself?

const federatedModules = withModuleFederationPlugin({
    name: 'mfe',
    exposes: {
        './DownloadModule': './src/app/download.module.ts',
    },
    remotes:{
        "mfe": "https://local.app/remoteEntry.js"
    },
    shared: {
        ...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto', eager: true })
    }
});

When I try this I get error: Uncaught TypeError: Cannot read properties of undefined (reading 'call') from bootstrap.ts

ng-druid commented 1 year ago

We are very interested in doing the same thing for our climate aware CMS Quell that makes heavy use of module federation including a plugin system built on top of it. https://github.com/rollthecloudinc/quell