Skip to content

Commit

Permalink
fix: set angular ts target to ES2015
Browse files Browse the repository at this point in the history
It is important to keep the target to ES2015, this ensures native async/await are downleveled to generators. This is required as zone.js doesn't support native async/await
  • Loading branch information
JeanMeche committed Nov 15, 2023
1 parent fc5e49a commit d721668
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
29 changes: 7 additions & 22 deletions angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
"browser": "src/main.ts",
"outputPath": "dist/demo",
"scripts": [],
"styles": [
"src/global_styles.css"
],
"styles": ["src/global_styles.css"],
"tsConfig": "src/tsconfig.app.json"
}
},
Expand All @@ -46,13 +44,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"exclude": [
"**/node_modules/**"
],
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
]
"exclude": ["**/node_modules/**"],
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"]
}
},
"serve": {
Expand All @@ -70,20 +63,12 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"assets": [
"src/favicon.ico",
"src/assets"
],
"assets": ["src/favicon.ico", "src/assets"],
"karmaConfig": "src/karma.conf.js",
"main": "src/test.ts",
"polyfills": [
"zone.js",
".zone.js/testing"
],
"polyfills": ["zone.js", ".zone.js/testing"],
"scripts": [],
"styles": [
"styles.css"
],
"styles": ["styles.css"],
"tsConfig": "src/tsconfig.spec.json"
}
}
Expand All @@ -96,4 +81,4 @@
}
},
"version": 1
}
}
4 changes: 2 additions & 2 deletions angular/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import 'zone.js';
import {Component} from '@angular/core';
import {bootstrapApplication} from '@angular/platform-browser';

@Component({
selector: 'app-root',
Expand Down
7 changes: 2 additions & 5 deletions angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"target": "ES2015",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"ES2022",
"dom"
]
"lib": ["ES2022", "dom"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down

0 comments on commit d721668

Please sign in to comment.