Skip to content

Commit f9f21ef

Browse files
hansldond2clouds
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 angular#8117.
1 parent c6777cc commit f9f21ef

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)