Skip to content

Commit

Permalink
fix: The remoteEntryChunk should use the base path from the Vite co…
Browse files Browse the repository at this point in the history
…nfig.

Fixes #629
  • Loading branch information
baijunjie authored Sep 20, 2024
1 parent 7facf72 commit 987f451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lib/src/prod/expose-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// SPDX-License-Identifier: MulanPSL-2.0
// *****************************************************************************

import { resolve, parse, basename, extname, relative, dirname } from 'path'
import { resolve, parse, basename, extname, relative, dirname, join } from 'path'
import {
getModuleMarker,
normalizePath,
Expand Down Expand Up @@ -239,7 +239,7 @@ export function prodExposePlugin(
const slashPath = fileRelativePath.replace(/\\/g, '/')
remoteEntryChunk.code = remoteEntryChunk.code.replace(
`\${__federation_expose_${expose[0]}}`,
`./${slashPath}`
join(viteConfigResolved.config?.base, viteConfigResolved.config?.build.assetsDir, slashPath)
)
}
}
Expand Down

0 comments on commit 987f451

Please sign in to comment.