File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ module.exports = class AliasPlugin {
107
107
prefix . length ,
108
108
innerRequest . length - suffix . length ,
109
109
) ;
110
- newRequestStr = item . alias . toString ( ) . replace ( "*" , match ) ;
110
+ newRequestStr = alias . toString ( ) . replace ( "*" , match ) ;
111
111
}
112
112
113
113
if (
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ describe("alias", () => {
27
27
"/e/index" : "" ,
28
28
"/e/anotherDir/index" : "" ,
29
29
"/e/dir/file" : "" ,
30
+ "/src/utils/a" : "" ,
31
+ "/src/components/b" : "" ,
30
32
} ,
31
33
"/" ,
32
34
) ;
@@ -45,6 +47,7 @@ describe("alias", () => {
45
47
"@*" : "/*" ,
46
48
"@e*" : "/e/*" ,
47
49
"@e*file" : "/e*file" ,
50
+ "shared/*" : [ "/src/utils/*" , "/src/components/*" ] ,
48
51
ignored : false ,
49
52
} ,
50
53
modules : "/" ,
@@ -175,4 +178,8 @@ describe("alias", () => {
175
178
done ( ) ;
176
179
} ) ;
177
180
} ) ;
181
+
182
+ it ( "should resolve a wildcard alias with multiple targets correctly" , ( ) => {
183
+ expect ( resolver . resolveSync ( { } , "/" , "shared/b" ) ) . toBe ( "/src/components/b" ) ;
184
+ } ) ;
178
185
} ) ;
You can’t perform that action at this time.
0 commit comments