Closed sabas closed 8 years ago
The TypeScript compiler has evolved since chapter 1 was originally written back in 2015 and hence its CLI basic syntax.
However bear in mind that targeting ES2016 will make the code to be transpiled into ES6 JavaScript which is still not supported by the vast majority of browsers out there.
A new tsconfig.json file has been posted for your convenience. You may use it with the following command:
$ tsc --watch
The --watch
option will watch typescript files for changes, reissuing the transpilation upon changes. Feel free to use it or remove it for compiling typescript files in one go.
tsc --init --experimentalDecorators --target commonjs
gives errorerror TS6047: Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.
Ref: page 4
Using ES6 the tsconfig becomes