Skip to content

Commit 35dd760

Browse files
psamusevhansl
authored andcommitted
feat(@angular-devkit/build-angular): support of tsx absolute path import (#11450)
1 parent c9dab34 commit 35dd760

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class AngularCompilerPlugin {
127127
private _platform: PLATFORM;
128128
private _JitMode = false;
129129
private _emitSkipped = true;
130-
private _changedFileExtensions = new Set(['ts', 'html', 'css']);
130+
private _changedFileExtensions = new Set(['ts', 'tsx', 'html', 'css']);
131131

132132
// Webpack plugin.
133133
private _firstRun = true;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function resolveWithPaths(
2727
}
2828

2929
// Only work on Javascript/TypeScript issuers.
30-
if (!request.contextInfo.issuer || !request.contextInfo.issuer.match(/\.[jt]s$/)) {
30+
if (!request.contextInfo.issuer || !request.contextInfo.issuer.match(/\.[jt]sx?$/)) {
3131
callback(null, request);
3232

3333
return;

packages/ngtools/webpack/src/transformers/ast_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ export function transformTypescript(
102102
}
103103

104104
// Return the transpiled js.
105-
return compilerHost.readFile(fileName.replace(/\.ts$/, '.js'));
105+
return compilerHost.readFile(fileName.replace(/\.tsx?$/, '.js'));
106106
}

0 commit comments

Comments
 (0)