The Angular CLI provides support for polyfills officially. When we create a new project with the ng new command, a
- Mandatory polyfills: These are installed automatically when we create our project with ng new command and the respective import statements enabled in ‘src/polyfills.ts’ file.
Optional polyfills: We need to install its npm package and then create import statement in ‘src/polyfills.ts’ file. For example, first we need to install below npm package for adding web animations (optional) polyfill.
bash npm install --save web-animations-jsand create import statement in polyfill file.