Skip to content

Commit 28cac99

Browse files
hanslBrocco
authored andcommitted
fix(@ngtools/webpack): allow path mapping to resolve in JS files
Previously we filtered our path mapping resolver to only be used on typescript. The correct behaviour is unclear; tsc does not resolve JS files, only TS. But there is a lot of value to use path mapping to resolve JavaScript files, and it replaces the webpack alias configuration option. Because of that value it was decided to fix this. Fixes #8117.
1 parent f700ba7 commit 28cac99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class PathsPlugin implements Tapable {
124124
this._nmf.plugin('before-resolve', (request: NormalModuleFactoryRequest,
125125
callback: Callback<any>) => {
126126
// Only work on TypeScript issuers.
127-
if (!request.contextInfo.issuer || !request.contextInfo.issuer.endsWith('.ts')) {
127+
if (!request.contextInfo.issuer || !request.contextInfo.issuer.match(/\.[jt]s$/)) {
128128
return callback(null, request);
129129
}
130130

0 commit comments

Comments
 (0)