Skip to content

Commit c65b026

Browse files
alan-agius4angular-robot[bot]
authored andcommitted
fix(@angular-devkit/build-angular): update the ECMA output warning message to be more actionable
Update the `TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022"` warning message to be more actionable. Closes: #24697
1 parent 77aa04c commit c65b026

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ export function createCompilerPlugin(
218218
(setupWarnings ??= []).push({
219219
text:
220220
'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' +
221-
'"false" respectively by the Angular CLI.',
221+
'"false" respectively by the Angular CLI.\n' +
222+
`NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.`,
222223
location: { file: pluginOptions.tsconfig },
223224
notes: [
224225
{

packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export function createIvyPlugin(
3535
wco.logger.warn(
3636
'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' +
3737
'"false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration. ' +
38-
'For more information, see https://angular.io/guide/build#configuring-browser-compatibility',
38+
'For more information, see https://angular.io/guide/build#configuring-browser-compatibility\n' +
39+
`NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.`,
3940
);
4041
}
4142

0 commit comments

Comments
 (0)