Skip to content

Commit

Permalink
fix(mfe): fix workerRemote
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Nov 12, 2024
1 parent fbf86c3 commit 105dcd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/builder/src/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export const makeRemoteScript = (
const url = new URL(remoteEntry);
// replace the default remote with the worker remote
// e.g. http://localhost:3000/remoteEntry.js -> http://localhost:3000/worker/remoteEntry.js
const pathname = url.pathname.split('/');
pathname.splice(-1, 0, 'worker');
const workerRemote = remoteEntry.replace(
url.pathname,
`/worker${url.pathname}`
pathname.join('/')
);
importScripts(workerRemote);
}
Expand Down

0 comments on commit 105dcd7

Please sign in to comment.