According to this issue reply
You need to follow the following steps
- Create a new tsconfig
tsconfig.es5.json
next to tsconfig.json with the below contents
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es5"
}
}
- In
angular.json
Underprojects:yourAppName:architect:build:configurations
, add
"es5": {
"tsConfig": "./tsconfig.es5.json"
}
and projects:yourAppName:architect:serve:configurations
add
"es5": {
"browserTarget": "yourAppName:build:es5"
}
Remember to change yourAppName in app:build:es5 to yourAppName!
full path shown below
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
},
"configurations": {
"production": {
...
},
"es5": {
"tsConfig": "./tsconfig.es5.json"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
...
},
"configurations": {
"production": {
...
},
"es5": {
"browserTarget": "yourAppName:build:es5"
}
}
},
- Run the serve with this configuration using the below command.
ng serve --configuration es5