Webpack loading remote module on an incorrect endpoint

26 views Asked by At

I am using webpack's module federation plugin for a microfrontend architecture.

The container app sends a request to the following

new ModuleFederationPlugin({
      name: 'container',
      filename: 'remoteEntry.js',
      remotes: {
        huddle: 'microfrontend@{domain}/AdditionalDir/remoteEntry.js'
      },

    })

For more context both frontends are on nginx pods served through a kubernetes cluster and the requests also get handled through an nginx proxy.

RemoteEntry.js gets loaded fine however the chunks get loaded like this domain/hash.js while i want it to load like this {domain}/AdditionalDir/hash.js is there a way to specify where i load my remote modules from ?? I've tried playing around with the publicPath in webpack's config with no luck.

0

There are 0 answers