Skip to content

Commit

Permalink
fix: try to get origin when importing remote entry
Browse files Browse the repository at this point in the history
  • Loading branch information
f4562 committed Dec 6, 2024
1 parent aaa23f5 commit f654a4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/pluginProxyRemoteEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
`;
}
Expand Down

0 comments on commit f654a4d

Please sign in to comment.