Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular-devkit/build-angular): support of tsx absolute path import #11450

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class AngularCompilerPlugin {
private _platform: PLATFORM;
private _JitMode = false;
private _emitSkipped = true;
private _changedFileExtensions = new Set(['ts', 'html', 'css']);
private _changedFileExtensions = new Set(['ts', 'tsx', 'html', 'css']);

// Webpack plugin.
private _firstRun = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/paths-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function resolveWithPaths(
}

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

return;
Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/transformers/ast_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ export function transformTypescript(
}

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