Skip to content

Commit

Permalink
fix virtual path formatting on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Jan 2, 2025
1 parent be99c48 commit e09d551
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ModuleRequest, RequestAdapter, RequestAdapterCreate, Resolution, VirtualResponse } from '@embroider/core';
import core from '@embroider/core';
import { resolve } from 'path';

const { cleanUrl, getUrlQueryParams } = core;
import type { PluginContext, ResolveIdResult } from 'rollup';
Expand Down Expand Up @@ -75,7 +76,10 @@ export class RollupRequestAdapter implements RequestAdapter<Resolution<ResolveId
type: 'found',
filename: virtual.specifier,
result: {
id: this.specifierWithQueryParams(virtual.specifier),
// The `resolve` here is necessary on windows, where we might have
// unix-like specifiers but Vite needs to see a real windows path in the
// result.
id: resolve(this.specifierWithQueryParams(virtual.specifier)),
resolvedBy: this.fromFileWithQueryParams(request.fromFile),
meta: {
'embroider-resolver': { virtual } satisfies ResponseMeta,
Expand Down

0 comments on commit e09d551

Please sign in to comment.