Skip to content

Commit

Permalink
Move vite.normalizePath
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesopstad committed Feb 5, 2025
1 parent d838df9 commit 81b7b70
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/vite-plugin-cloudflare/src/modules-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,12 @@ export function modulesPlugin(
});

const emittedFileName = this.getFileName(referenceId);
const relativePath = path.relative(
path.dirname(chunk.fileName),
emittedFileName
);
const importPath = vite.normalizePath(
relativePath.startsWith(".") ? relativePath : `./${relativePath}`
const relativePath = vite.normalizePath(
path.relative(path.dirname(chunk.fileName), emittedFileName)
);
const importPath = relativePath.startsWith(".")
? relativePath
: `./${relativePath}`;

s.update(match.index, match.index + full.length, importPath);
}
Expand Down

0 comments on commit 81b7b70

Please sign in to comment.