Skip to content

Commit

Permalink
fix(dev-server-rollup): fix rollup adapter virtual modules resolution…
Browse files Browse the repository at this point in the history
… for windows environments

close modernweb-dev#2078
  • Loading branch information
giamir committed Dec 4, 2022
1 parent 7023c3d commit 3f3f194
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-geese-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/dev-server-rollup': patch
---

fix rollup adapter virtual modules resolution for windows environments
6 changes: 5 additions & 1 deletion packages/dev-server-rollup/src/rollupAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ export function rollupAdapter(
return;
}

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

0 comments on commit 3f3f194

Please sign in to comment.