Package Exports
- next-external-remotes-plugin
- next-external-remotes-plugin/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (next-external-remotes-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
next-external-remotes-plugin
This plugin is a fork from Zackary Jackson's ExternalTemplateRemotesPlugin (https://www.npmjs.com/package/external-remotes-plugin) and it was adapted to work properly with NextFederationPlugin (https://www.npmjs.com/package/@module-federation/nextjs-mf).
Env config
APP1="https://url-to-my-mf-in-some-environment"
Host next.config.js
const NextExternalTemplateRemotesPlugin = require('./next-external-remotes-plugin');
module.exports = {
// ...
// ...
webpack(config) {
config.plugins.push(
new NextFederationPlugin({
name: 'container',
remotes: {
app1: 'app1@[window.__NEXT_DATA__.runtimeConfig.app1]'
},
filename: 'static/chunks/container.js',
shared: {},
}),
new NextExternalTemplateRemotesPlugin()
);
return config;
},
publicRuntimeConfig: {
app1: process.env.APP1
},
// ...
// ...
}