Unexpected token with optimization true in angular

This bug happens since we have migrated to angular 11.

With angular config in angular.json:

“optimization”: true,
“outputHashing”: “all”,
“sourceMap”: true,
“namedChunks”: false,
“aot”: true,
“extractLicenses”: true,
“vendorChunk”: false,
“buildOptimizer”: true

When we build the project and deploy it in nginx, Uncaught SyntaxError: Unexpected token ‘,’ error is thrown.

If we change optimization to false, everything works again

The bug is solved, we have NG_BUILD_MANGLE=false added from other dependency, on remove NG_BUILD_MANGLE=false, everything works again

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.