Skip to content

Commit 352f20e

Browse files
baijunjieJiannan-dev
authored andcommitted
fix: The remoteEntryChunk should use the base path from the Vite config.
1 parent 0258207 commit 352f20e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/lib/src/prod/expose-production.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ export function prodExposePlugin(
239239
const slashPath = fileRelativePath.replace(/\\/g, '/')
240240
remoteEntryChunk.code = remoteEntryChunk.code.replace(
241241
`\${__federation_expose_${expose[0]}}`,
242-
`./${slashPath}`
242+
[
243+
viteConfigResolved.config?.base?.replace(/\/+$/, '') || '.',
244+
viteConfigResolved.config?.build?.assetsDir?.replace(/\/+$/, ''),
245+
slashPath
246+
].filter(Boolean).join('/')
243247
)
244248
}
245249
}

0 commit comments

Comments
 (0)