Skip to content

Commit

Permalink
Does this work
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Feb 15, 2022
1 parent dcae5a4 commit da47091
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/astro/src/vite-plugin-astro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
if(from) {
const { query: fromQuery, filename } = parseAstroRequest(from);
if(fromQuery.astro && isRelativePath(id)) {
const resolvedURL = new URL(id, pathToFileURL(filename));
const resolved = fileURLToPath(resolvedURL);
const resolvedURL = new URL(id, `file://${filename}`);
const resolved = resolvedURL.pathname;

console.log("WINDOWS DEBUG2", isBrowserPath(slash(resolved)), filename, from,resolved, slash(resolved))
if(isBrowserPath(slash(resolved))) {
return fileURLToPath(new URL('.' + slash(resolved), config.projectRoot));
console.log("WINDOWS DEBUG2", resolved);
if(isBrowserPath(resolved)) {
return slash(fileURLToPath(new URL('.' + resolved, config.projectRoot)));
}
return resolved;
return slash(fileURLToPath(resolvedURL));
}
}

Expand Down

0 comments on commit da47091

Please sign in to comment.