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 {
107107 prefix . length ,
108108 innerRequest . length - suffix . length ,
109109 ) ;
110- newRequestStr = item . alias . toString ( ) . replace ( "*" , match ) ;
110+ newRequestStr = alias . toString ( ) . replace ( "*" , match ) ;
111111 }
112112
113113 if (
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ describe("alias", () => {
2727 "/e/index" : "" ,
2828 "/e/anotherDir/index" : "" ,
2929 "/e/dir/file" : "" ,
30+ "/src/utils/a" : "" ,
31+ "/src/components/b" : "" ,
3032 } ,
3133 "/" ,
3234 ) ;
@@ -45,6 +47,7 @@ describe("alias", () => {
4547 "@*" : "/*" ,
4648 "@e*" : "/e/*" ,
4749 "@e*file" : "/e*file" ,
50+ "shared/*" : [ "/src/utils/*" , "/src/components/*" ] ,
4851 ignored : false ,
4952 } ,
5053 modules : "/" ,
@@ -175,4 +178,8 @@ describe("alias", () => {
175178 done ( ) ;
176179 } ) ;
177180 } ) ;
181+
182+ it ( "should resolve a wildcard alias with multiple targets correctly" , ( ) => {
183+ expect ( resolver . resolveSync ( { } , "/" , "shared/b" ) ) . toBe ( "/src/components/b" ) ;
184+ } ) ;
178185} ) ;
You can’t perform that action at this time.
0 commit comments