{
"compilerOptions": {
"target": "es5"
}
}
I have tsconfig.json
as above, and when I run command tsc app.ts --watch
, I hit error
Accessors are only available when targeting ECMAScript 5 and higher
If I explicitly set the target in my command, it works
tsc -t es5 app.ts --watch
Any lead to which part may have gone wrong, why the discrepancy between two outcomes?
UPDATES
Documentation says
When input files are specified on the command line, tsconfig.json files are ignored.
That's why when you run tsc app.ts --watch
, your tsconfig.json file isn't being applied. You're providing app.ts
.
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