Skip to content

Commit

Permalink
fix: 792 - correct img path on windows machines
Browse files Browse the repository at this point in the history
  • Loading branch information
karlovich committed Feb 12, 2025
1 parent 78db4a9 commit 4d68888
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function stubNextAssetImport() {
name: 'stub-next-asset-import',
transform(_code: string, id: string) {
if (/(jpg|jpeg|png|webp|gif|svg)$/.test(id)) {
const imgSrc = relative(process.cwd(), id);
const imgSrc = relative(process.cwd(), id).split('\\').join('/');

return { code: `export default { src: '/${imgSrc}', height: 1, width: 1 }` };
}
Expand Down

0 comments on commit 4d68888

Please sign in to comment.