Here is my tsconfig.json file:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es6",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
When I changed lib and target version to es2020 it gives me below error:
tsconfig.json(13,15): error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.
es2020 support was introduced in TypeScript 3.8.
You must upgrade to Angular 9.1 (or later) to use TypeScript 3.8.
I don't think es2020 was added as a target until Angular 9. So if you're on a version lower than that, I could see it not working.
esnext targets the latest supported features, so that should work very similarly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With