This repository was archived by the owner on Aug 4, 2021. It is now read-only.
File tree 3 files changed +12
-1
lines changed
3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 1.3.1" ,
4
4
"description" : " Resolves aliases with Rollup" ,
5
5
"main" : " dist/rollup-plugin-alias.js" ,
6
+ "module" : " dist/rollup-plugin-alias.es2015.js" ,
6
7
"jsnext:main" : " dist/rollup-plugin-alias.es2015.js" ,
7
8
"scripts" : {
8
9
"prebuild" : " rimraf dist" ,
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 @@ -88,6 +88,16 @@ test('Absolute local aliasing', t => {
88
88
t . is ( resolved4 , '/par/a/di/se.js' ) ;
89
89
} ) ;
90
90
91
+ test ( 'Leaves entry file untouched if matches alias' , t => {
92
+ const result = alias ( {
93
+ abacaxi : './abacaxi' ,
94
+ } ) ;
95
+
96
+ const resolved = result . resolveId ( 'abacaxi/entry.js' , undefined ) ;
97
+
98
+ t . is ( resolved , null ) ;
99
+ } ) ;
100
+
91
101
test ( 'Test for the resolve property' , t => {
92
102
const result = alias ( {
93
103
ember : './folder/hipster' ,
You can’t perform that action at this time.
0 commit comments