Skip to content

Commit 070da72

Browse files
committed
fix(@angular-devkit/build-angular): do not perform advanced optimizations on @angular/common/locales/global
This entry-points are side effectful. (cherry picked from commit 62d26db)
1 parent 411e3de commit 070da72

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/javascript-transformer-worker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ async function transformWithBabel({
5050
return useInputSourcemap ? data : data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '');
5151
}
5252

53-
// @angular/platform-server/init entry-point has side-effects.
53+
// `@angular/platform-server/init` and `@angular/common/locales/global` entry-points are side effectful.
5454
const safeAngularPackage =
5555
/[\\/]node_modules[\\/]@angular[\\/]/.test(filename) &&
56-
!/@angular[\\/]platform-server[\\/]f?esm2022[\\/]init/.test(filename);
56+
!/@angular[\\/]platform-server[\\/]f?esm2022[\\/]init/.test(filename) &&
57+
!/@angular[\\/]common[\\/]locales[\\/]global/.test(filename);
5758

5859
// Lazy load the linker plugin only when linking is required
5960
if (shouldLink) {

0 commit comments

Comments
 (0)