Skip to content

Commit

Permalink
Fix preserveModulesRoot path on Windows (#3791)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Sep 21, 2020
1 parent b2172df commit b7bb660
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Chunk.ts
Expand Up @@ -456,7 +456,7 @@ export default class Chunk {
const currentPath = `${currentDir}/${fileName}`;
const { preserveModulesRoot } = options;
if (preserveModulesRoot && currentPath.startsWith(preserveModulesRoot)) {
path = currentPath.slice(preserveModulesRoot.length).replace(/^\//, '');
path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, '');
} else {
path = relative(preserveModulesRelativeDir, currentPath);
}
Expand Down

0 comments on commit b7bb660

Please sign in to comment.