@@ -3,7 +3,7 @@ import path from 'path';
33import { warn } from './log' ;
44import mapToRelative from './mapToRelative' ;
55import normalizeOptions from './normalizeOptions' ;
6- import { nodeResolvePath , replaceExtension , toLocalPath , toPosixPath } from './utils' ;
6+ import { nodeResolvePath , replaceExtension , isRelativePath , toLocalPath , toPosixPath } from './utils' ;
77
88function getRelativePath ( sourcePath , currentFile , absFileInRoot , opts ) {
99 const realSourceFileExtension = path . extname ( absFileInRoot ) ;
@@ -64,7 +64,7 @@ function resolvePathFromAliasConfig(sourcePath, currentFile, opts) {
6464 return null ;
6565 }
6666
67- if ( aliasedSourceFile [ 0 ] === '.' ) {
67+ if ( isRelativePath ( aliasedSourceFile ) ) {
6868 return toLocalPath ( toPosixPath (
6969 mapToRelative ( opts . cwd , currentFile , aliasedSourceFile ) ) ,
7070 ) ;
@@ -83,7 +83,7 @@ const resolvers = [
8383] ;
8484
8585export default function resolvePath ( sourcePath , currentFile , opts ) {
86- if ( sourcePath [ 0 ] === '.' ) {
86+ if ( isRelativePath ( sourcePath ) ) {
8787 return sourcePath ;
8888 }
8989
0 commit comments