Fix dev resolution of client modules on Windows (#2768)
* Fix dev resolution of client modules on Windows * Adds a changeset
This commit is contained in:
parent
d4dbfe8974
commit
49c0d9970f
2 changed files with 7 additions and 1 deletions
5
.changeset/strange-kings-add.md
Normal file
5
.changeset/strange-kings-add.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes loading astro/client/\* on Windows in dev
|
|
@ -8,6 +8,7 @@ import { RouteCache } from '../route-cache.js';
|
||||||
import { resolveRenderers } from './renderers.js';
|
import { resolveRenderers } from './renderers.js';
|
||||||
import { errorHandler } from './error.js';
|
import { errorHandler } from './error.js';
|
||||||
import { getHmrScript } from './hmr.js';
|
import { getHmrScript } from './hmr.js';
|
||||||
|
import { prependForwardSlash } from '../../path.js';
|
||||||
import { render as coreRender } from '../core.js';
|
import { render as coreRender } from '../core.js';
|
||||||
import { createModuleScriptElementWithSrcSet } from '../ssr-element.js';
|
import { createModuleScriptElementWithSrcSet } from '../ssr-element.js';
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ export async function render(renderers: Renderer[], mod: ComponentInstance, ssrO
|
||||||
// broken in the legacy build. This can be removed once the legacy build is removed.
|
// broken in the legacy build. This can be removed once the legacy build is removed.
|
||||||
if (!astroConfig.buildOptions.legacyBuild) {
|
if (!astroConfig.buildOptions.legacyBuild) {
|
||||||
const [, resolvedPath] = await viteServer.moduleGraph.resolveUrl(s);
|
const [, resolvedPath] = await viteServer.moduleGraph.resolveUrl(s);
|
||||||
return resolvedPath;
|
return '/@fs' + prependForwardSlash(resolvedPath);
|
||||||
} else {
|
} else {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue