From ed70d099329aea563e306c44f78ef799b3153b44 Mon Sep 17 00:00:00 2001 From: skrtheboss Date: Wed, 8 Nov 2023 17:52:37 +0100 Subject: [PATCH 1/2] fix(core): use esm2022 instead of fesm2022 for secondary entrypoints in ng-package-lite --- .../ng-package/entry-point/write-package.transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts index 475f8a8ada820..4a8366eeaad8c 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts @@ -135,7 +135,7 @@ export const nxWritePackageTransform = (options: NgPackagrOptions) => await writeFile( path.join(ngEntryPoint.destinationPath, 'package.json'), JSON.stringify( - { module: relativeUnixFromDestPath(destinationFiles.fesm2022) }, + { module: relativeUnixFromDestPath(destinationFiles.esm2022) }, // esm2022 is used since ng-packager-lite does not provide fesm2022 undefined, 2 ) From b3e9512b09526209afb826c969050b4894a6d300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Tue, 14 Nov 2023 15:50:00 +0100 Subject: [PATCH 2/2] fix(angular): account for differences between angular versions --- .../ng-package/entry-point/write-package.transform.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts index 4a8366eeaad8c..0f82cec2dc824 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts @@ -135,7 +135,13 @@ export const nxWritePackageTransform = (options: NgPackagrOptions) => await writeFile( path.join(ngEntryPoint.destinationPath, 'package.json'), JSON.stringify( - { module: relativeUnixFromDestPath(destinationFiles.esm2022) }, // esm2022 is used since ng-packager-lite does not provide fesm2022 + { + module: relativeUnixFromDestPath( + angularVersion.major < 16 + ? (destinationFiles as any).esm2020 + : destinationFiles.esm2022 + ), + }, undefined, 2 )