Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/lib/src/dev/remote-development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ async function __federation_method_ensure(remoteId) {
return new Promise((resolve, reject) => {
const getUrl = typeof remote.url === 'function' ? remote.url : () => Promise.resolve(remote.url);
getUrl().then(url => {
import(/* @vite-ignore */ url).then(lib => {
const importer = remote.format === 'systemjs'
? System.import(/* @vite-ignore */ url)
: import(/* @vite-ignore */ url)
importer.then(lib => {
if (!remote.inited) {
const shareScope = wrapShareScope(remote.from)
lib.init(shareScope);
Expand Down Expand Up @@ -125,7 +128,7 @@ function __federation_method_wrapDefault(module ,need){
obj.__esModule = true;
return obj;
}
return module;
return module;
}

function __federation_method_getRemote(remoteName, componentName){
Expand Down
5 changes: 4 additions & 1 deletion packages/lib/src/prod/remote-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ export function prodRemotePlugin(
return new Promise((resolve, reject) => {
const getUrl = typeof remote.url === 'function' ? remote.url : () => Promise.resolve(remote.url);
getUrl().then(url => {
import(/* @vite-ignore */ url).then(lib => {
const importer = remote.format === 'systemjs'
? System.import(/* @vite-ignore */ url)
: import(/* @vite-ignore */ url)
importer.then(lib => {
if (!remote.inited) {
const shareScope = wrapShareModule(remote.from)
lib.init(shareScope);
Expand Down