Skip to content

Commit d7d95ab

Browse files
r4nd0meddyerburgh
authored andcommitted
fix: handle absolute paths when resolving paths on Windows (#196)
1 parent abcaaf2 commit d7d95ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/module-name-mapper-helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const matchModuleImport = /^[^?]*~/
1111
function resolve(to, importPath, fileType) {
1212
importPath =
1313
path.extname(importPath) === '' ? `${importPath}.${fileType}` : importPath
14-
if (importPath.startsWith('/')) {
14+
if (path.isAbsolute(importPath)) {
1515
return importPath
1616
} else if (matchModuleImport.test(importPath)) {
1717
return require.resolve(importPath.replace(matchModuleImport, ''))

0 commit comments

Comments
 (0)