Skip to content

Commit

Permalink
fix(dev-server-rollup): fix rollup adapter resolution for virtual mod…
Browse files Browse the repository at this point in the history
…ules on Windows

close modernweb-dev#2078
  • Loading branch information
akrawitz authored and koddsson committed Aug 1, 2023
1 parent 9c511e4 commit 57a2d39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/two-ants-explode.md
@@ -0,0 +1,5 @@
---
'@web/dev-server-rollup': patch
---

fix rollup adapter resolution for virtual modules on Windows
8 changes: 7 additions & 1 deletion packages/dev-server-rollup/src/rollupAdapter.ts
Expand Up @@ -148,7 +148,13 @@ export function rollupAdapter(
return;
}

if (!injectedFilePath && !path.isAbsolute(source) && whatwgUrl.parseURL(source) != null) {
const isVirtualModule = source.startsWith('\0');
if (
!injectedFilePath &&
!path.isAbsolute(source) &&
whatwgUrl.parseURL(source) != null &&
!isVirtualModule
) {
// don't resolve relative and valid urls
return source;
}
Expand Down

0 comments on commit 57a2d39

Please sign in to comment.