Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): do not perform advanced optimizat…
Browse files Browse the repository at this point in the history
…ions on `@angular/common/locales/global`

This entry-points are side effectful.

(cherry picked from commit 62d26db)
  • Loading branch information
alan-agius4 committed Oct 26, 2023
1 parent 411e3de commit 070da72
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -50,10 +50,11 @@ async function transformWithBabel({
return useInputSourcemap ? data : data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '');
}

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

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

0 comments on commit 070da72

Please sign in to comment.