From f654a4d6cb814d1055fa034c5e4677c4770b1b78 Mon Sep 17 00:00:00 2001 From: f4562 Date: Fri, 6 Dec 2024 06:56:54 +0100 Subject: [PATCH] fix: try to get origin when importing remote entry --- src/plugins/pluginProxyRemoteEntry.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() `; }