Skip to content

Commit

Permalink
fix: improve vitest support
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Oct 5, 2023
1 parent bf7237d commit 3f5e52e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/seven-icons-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/vite": patch
---

Fix issue where queries added from vitest were not being stripped
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ function stripVersionAndTimeStamp(id: string) {
const queryStart = id.indexOf("?");
if (queryStart === -1) return id;
const url = id.slice(0, queryStart);
const query = id.slice(queryStart + 1).replace(/(?:^|[&])[vt]=[^&]/g, "");
const query = id.slice(queryStart + 1).replace(/(?:^|[&])[vt]=[^&]+/g, "");
if (query) return `${url}?${query}`;
return url;
}

0 comments on commit 3f5e52e

Please sign in to comment.