Skip to content

Commit

Permalink
fix: use posix path style
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Feb 7, 2025
1 parent adcc1e6 commit 82a83c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@wroud/vite-plugin-asset-resolver/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function assetResolverPlugin(
return resolved;
}

const pathParts = importer.split(path.sep);
const pathParts = importer.split(path.posix.sep);

let distIndex = -1;
for (let i = pathParts.length - 1; i >= 0; i--) {
Expand All @@ -60,7 +60,7 @@ export function assetResolverPlugin(
for (const srcAlias of src) {
pathParts[distIndex] = srcAlias;

let adjustedImporter = path.join(...pathParts);
let adjustedImporter = path.posix.join(...pathParts);

if (importer.startsWith("/")) {
adjustedImporter = "/" + adjustedImporter;
Expand Down

0 comments on commit 82a83c4

Please sign in to comment.