After downloading your demo code, I changed the remote directory to 'remote1' and also changed the corresponding configuration to 'remote1'. Why did it fail to locate remote?
But I changed all the remote1s back to remote and they still run normally, so I don't understand where the components have already been registered and cannot be changed?
host's vite.config.js
federation({
name: 'host',
remotes: {
remote: {
type: 'module',
name: 'remote1',
entry: 'http://localhost:4174/remoteEntry.js',
entryGlobalName: 'remote1',
shareScope: 'default',
},
},
exposes: {},
filename: 'remoteEntry.js',
shared: {
react: {
requiredVersion: dependencies.react,
singleton: true,
},
},
})
host's App.tsx
const Remote = lazy(
// @ts-ignore
async () => import('remote1/remote-app')
);
remote1's vite.config.js
federation({
filename: 'remoteEntry.js',
name: 'remote1',
exposes: {
'./remote-app': './src/App.tsx',
},
remotes: {},
shared: {
react: {
requiredVersion: dependencies.react,
singleton: true,
},
},
}),
After downloading your demo code, I changed the remote directory to 'remote1' and also changed the corresponding configuration to 'remote1'. Why did it fail to locate remote?
But I changed all the remote1s back to remote and they still run normally, so I don't understand where the components have already been registered and cannot be changed?
host's vite.config.js
host's App.tsx
remote1's vite.config.js