@@ -463,18 +463,18 @@ function createCompilerOptionsTransformer(
463
463
) : Parameters < AngularCompilation [ 'initialize' ] > [ 2 ] {
464
464
return ( compilerOptions ) => {
465
465
// target of 9 is ES2022 (using the number avoids an expensive import of typescript just for an enum)
466
- if ( compilerOptions . target === undefined || compilerOptions . target < 9 ) {
466
+ if ( compilerOptions . target === undefined || compilerOptions . target < 9 /** ES2022 */ ) {
467
467
// If 'useDefineForClassFields' is already defined in the users project leave the value as is.
468
468
// Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995
469
469
// which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well.
470
- compilerOptions . target = 9 ;
470
+ compilerOptions . target = 9 /** ES2022 */ ;
471
471
compilerOptions . useDefineForClassFields ??= false ;
472
472
473
473
// Only add the warning on the initial build
474
474
setupWarnings ?. push ( {
475
475
text :
476
- ' TypeScript compiler options " target" and " useDefineForClassFields" are set to " ES2022" and ' +
477
- '" false" respectively by the Angular CLI.' ,
476
+ ` TypeScript compiler options ' target' and ' useDefineForClassFields' are set to ' ES2022' and ` +
477
+ `' false' respectively by the Angular CLI.` ,
478
478
location : { file : pluginOptions . tsconfig } ,
479
479
notes : [
480
480
{
@@ -507,6 +507,15 @@ function createCompilerOptionsTransformer(
507
507
compilerOptions . incremental = false ;
508
508
}
509
509
510
+ if ( compilerOptions . module === undefined || compilerOptions . module < 5 /** ES2015 */ ) {
511
+ compilerOptions . module = 7 ; /** ES2022 */
512
+ setupWarnings ?. push ( {
513
+ text : `TypeScript compiler options 'module' values 'CommonJS', 'UMD', 'System' and 'AMD' are not supported.` ,
514
+ location : null ,
515
+ notes : [ { text : `The 'module' option will be set to 'ES2022' instead.` } ] ,
516
+ } ) ;
517
+ }
518
+
510
519
return {
511
520
...compilerOptions ,
512
521
noEmitOnError : false ,
0 commit comments