Skip to content

Commit

Permalink
fix: fix relative resolving for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 19, 2020
1 parent da7c5ab commit abf3f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ export function createResolver(
let dirname = path.dirname(publicPath)
for (const alias in literalDirAlias) {
if (publicPath.startsWith(alias)) {
dirname = path.join('/', path.relative(root, literalDirAlias[alias]))
const relativeFilePath = path.relative(root, literalDirAlias[alias])
if (!relativeFilePath.startsWith('..')) {
dirname = '/' + slash(relativeFilePath)
}
break
}
}
Expand Down

0 comments on commit abf3f7a

Please sign in to comment.