We just migrated from angular 7 to angular 9. My application targets to larger audience and i need to support legacy browsers like IE-11. Hence i have made the following change in tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
The target is set to
"target": "es5",
which will target to legacy browsers as mentioned Here which will generate the build artifacts as folows
But if you see carefully, there are two polyfills that are gernerated,
chunk {2} polyfills.js (polyfills) 46.5 kB [initial] [rendered]
chunk {3} polyfills-es5.js (polyfills-es5) 129 kB [initial] [rendered]
But i want to generate only one polyfill which supports both modern and legacy browsers. Is there any way to generate only one polyfill (polyfills.js) file like how it used to happen before angular 8+ ?

polyfill.jsafter the build ?