Skip to content

Commit aa236c1

Browse files
committed
fix(webpack): paths plugin wildcard regex fix
1 parent 0365118 commit aa236c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/@ngtools/webpack/src/paths-plugin.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export class PathsPlugin implements Tapable {
9696
aliasPattern = new RegExp(`^${excapedAlias}$`);
9797
} else {
9898
let withStarCapturing = excapedAlias.replace('\\*', '(.*)');
99-
aliasPattern = new RegExp(`^${withStarCapturing}`);
99+
aliasPattern = withStarCapturing === '(.*)' ?
100+
new RegExp(excapedAlias) : new RegExp(`^${withStarCapturing}`);
100101
}
101102

102103
this.mappings.push({
@@ -163,7 +164,7 @@ export class PathsPlugin implements Tapable {
163164
}
164165

165166
createPlugin(resolver: ResolverPlugin, mapping: any): any {
166-
return (request: any, callback: Callback<any>) => {
167+
return (request: Request, callback: Callback<any>) => {
167168
try {
168169
this.resolve(resolver, mapping, request, callback);
169170
} catch (err) {

0 commit comments

Comments
 (0)