Skip to content

Commit

Permalink
Fix path seperator in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yenshih committed Aug 11, 2018
1 parent 6333aa2 commit 8655fb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/resolveImportUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function resolveImportUrl(
}

const absolutePathToResource = path.resolve(path.dirname(file), pathToResource);
const relativePathFromContextToResource = path.relative(this.context, absolutePathToResource);
const relativePathFromContextToResource = path.relative(this.context, absolutePathToResource)
.split(path.sep)
.join('/');
const quote = (match.match(/['"]$/) || [''])[0];

return `${importDeclaration}${spacingOrOptions}${quote}${relativePathFromContextToResource}${quote}`;
Expand Down

0 comments on commit 8655fb7

Please sign in to comment.