Skip to content

Commit 103b4da

Browse files
committed
Ensure sourcemap sources have Unix-style paths
1 parent ccc2336 commit 103b4da

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ module.exports = function(options) {
3838
if (map) {
3939
// This makes sure the paths in the generated source map (file and
4040
// sources) are relative to file.base:
41-
map.file = file.relative;
42-
map.sources = map.sources.map(function (fileName) {
43-
return path.relative(file.base, fileName);
41+
map.file = unixStylePath(file.relative);
42+
map.sources = map.sources.map(function(fileName) {
43+
return unixStylePath(path.relative(file.base, fileName));
4444
});
4545
file.sourceMap = map;
4646
}
@@ -58,3 +58,7 @@ module.exports = function(options) {
5858
this.emit('end');
5959
});
6060
};
61+
62+
function unixStylePath(filePath) {
63+
return filePath.split(path.sep).join('/');
64+
}

0 commit comments

Comments
 (0)