From c65b026e2f375f35826d985c8cc558a2729b520e Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 10 Feb 2023 16:43:06 +0000 Subject: [PATCH] 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 --- .../src/builders/browser-esbuild/compiler-plugin.ts | 3 ++- .../build_angular/src/webpack/plugins/typescript.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts index c0a6cc9807aa..84a8aa721a71 100644 --- a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts +++ b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts @@ -218,7 +218,8 @@ export function createCompilerPlugin( (setupWarnings ??= []).push({ text: 'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' + - '"false" respectively by the Angular CLI.', + '"false" respectively by the Angular CLI.\n' + + `NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.`, location: { file: pluginOptions.tsconfig }, notes: [ { diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts index 0d9b3714cdd2..43247ee2e748 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/typescript.ts @@ -35,7 +35,8 @@ export function createIvyPlugin( wco.logger.warn( 'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' + '"false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration. ' + - 'For more information, see https://angular.io/guide/build#configuring-browser-compatibility', + 'For more information, see https://angular.io/guide/build#configuring-browser-compatibility\n' + + `NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.`, ); }