Skip to content

Commit ae3fdcc

Browse files
authored
will fix invalid path resolution in non-unix OS
please keep in mind you also have Windows users :)
1 parent abcaaf2 commit ae3fdcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/module-name-mapper-helper.js

Lines changed: 1 addition & 1 deletion
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)