Skip to content

Fixes #687 #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged
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
4 changes: 3 additions & 1 deletion packages/lib/src/dev/remote-development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { ConfigTypeSet, VitePluginFederationOptions } from 'types'
import { walk } from 'estree-walker'
import MagicString from 'magic-string'
import { readFileSync } from 'fs'
import { posix } from 'path'
import type { AcornNode, TransformPluginContext } from 'rollup'
import type { ViteDevServer } from '../../types/viteDevServer'
import {
Expand Down Expand Up @@ -380,6 +381,7 @@ export {__federation_method_ensure, __federation_method_getRemote , __federation
const res: string[] = []
if (shared.length) {
const serverConfiguration = viteDevServer.config.server
const base = viteDevServer.config.base
const cwdPath = normalizePath(process.cwd())

for (const item of shared) {
Expand All @@ -393,7 +395,7 @@ export {__federation_method_ensure, __federation_method_getRemote , __federation
const idx = moduleFilePath.indexOf(cwdPath)

const relativePath =
idx === 0 ? moduleFilePath.slice(cwdPath.length) : null
idx === 0 ? posix.join(base, moduleFilePath.slice(cwdPath.length)) : null

const sharedName = item[0]
const obj = item[1]
Expand Down
Loading