File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export default function alias(options = {}) {
59
59
// First match is supposed to be the correct one
60
60
const toReplace = aliasKeys . find ( key => matches ( key , importeeId ) ) ;
61
61
62
- if ( ! toReplace ) {
62
+ if ( ! toReplace || ! importerId ) {
63
63
return null ;
64
64
}
65
65
Original file line number Diff line number Diff line change @@ -87,6 +87,16 @@ test('Absolute local aliasing', t => {
87
87
t . is ( resolved4 , '/par/a/di/se.js' ) ;
88
88
} ) ;
89
89
90
+ test ( 'Leaves entry file untouched if matches alias' , t => {
91
+ const result = alias ( {
92
+ abacaxi : './abacaxi' ,
93
+ } ) ;
94
+
95
+ const resolved = result . resolveId ( 'abacaxi/entry.js' , undefined ) ;
96
+
97
+ t . is ( resolved , null ) ;
98
+ } ) ;
99
+
90
100
test ( 'Test for the resolve property' , t => {
91
101
const result = alias ( {
92
102
ember : './folder/hipster' ,
You can’t perform that action at this time.
0 commit comments