Skip to content

Commit 9ad1b44

Browse files
authored
fixing deno-vite-plugin (#1230)
1 parent 1c64f48 commit 9ad1b44

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/deno-vite-plugin/src/resolver.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ export async function resolveViteSpecifier(
169169
}
170170
}
171171

172+
// Check if import.meta.resolve gave us a local file path
173+
if (id.startsWith("file://")) {
174+
const filePath = fileURLToPath(id);
175+
// If this is a local workspace package, return it directly
176+
// This avoids expensive deno info calls on workspace packages
177+
if (filePath.startsWith(path.resolve(root, "../"))) {
178+
console.log("[resolver] Local workspace package, returning directly:", filePath);
179+
return filePath;
180+
}
181+
}
182+
172183
if (importer && isDenoSpecifier(importer)) {
173184
const { resolved: parent } = parseDenoSpecifier(importer);
174185

0 commit comments

Comments
 (0)