diff --git a/src/plugins/pluginProxyRemoteEntry.ts b/src/plugins/pluginProxyRemoteEntry.ts index 558e890..996035b 100644 --- a/src/plugins/pluginProxyRemoteEntry.ts +++ b/src/plugins/pluginProxyRemoteEntry.ts @@ -61,7 +61,8 @@ export default function (): Plugin { ? viteConfig.server.host : 'localhost'; return ` - const {init} = await import("//${host}:${viteConfig.server?.port}${viteConfig.base + options.filename}") + const origin = window ? window.origin : "//${host}:${viteConfig.server?.port}" + const {init} = await import(origin + "${viteConfig.base + options.filename}") init() `; }