From daef49d0cbae287c954d09551850665ec0810656 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:02:28 -0400 Subject: [PATCH] fix(@angular-devkit/build-angular): limit advanced terser passes to two Limiting the terser passes to two helps to workaround an issue with terser wherein terser will errantly inline a function argument containing a `yield` expression inside an inner arrow function. This results in a syntax error since the yield expression is no longer within the scope of a generator. --- .../src/webpack/plugins/javascript-optimizer-worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/javascript-optimizer-worker.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/javascript-optimizer-worker.ts index e964ac01c3c2..0e423bedb223 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/javascript-optimizer-worker.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/javascript-optimizer-worker.ts @@ -93,7 +93,7 @@ async function optimizeWithTerser( { [name]: code }, { compress: { - passes: advanced ? 3 : 1, + passes: advanced ? 2 : 1, pure_getters: advanced, }, ecma: target,