Skip to content

Commit 2c2b499

Browse files
clydinfilipesilva
authored andcommitted
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.
1 parent fefd6d0 commit 2c2b499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/javascript-optimizer-worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async function optimizeWithTerser(
9393
{ [name]: code },
9494
{
9595
compress: {
96-
passes: advanced ? 3 : 1,
96+
passes: advanced ? 2 : 1,
9797
pure_getters: advanced,
9898
},
9999
ecma: target,

0 commit comments

Comments
 (0)