Reputation: 93
After trying to migrate form Angular 9 to 13, ng build --configuration production is not creating the polyfills-es5.js file which I need for IE 11. Is there any way to support IE 11 in Angular 13..?
I tried below things
Updated tsconfig.json file to target to es5
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"module": "es2020",
"moduleResolution": "node",
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
Updated polyfills.ts files
* BROWSER POLYFILLS
*/
import 'core-js';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
I also read somewhere to update the browserslist file, but I am not able to find browserslist file in my project folder.
Upvotes: 4
Views: 5377
Reputation: 885
This is all about transpiling to the correct module def and pulling in the correct polyfills (shims) for ie11. It's a pain now :(
https://www.bitovi.com/blog/ie-11-and-angular-overview.html
Upvotes: 3