November 2019
Beginner
804 pages
20h 1m
English
As you might guess, you can also easily build your project both in one-shot and in watch mode from the Terminal.
To build the project once, simply execute npm run tsc, as we saw before.
To build the project in watch mode, you can run npm run tsc -- --watch. Again, alternatively, you can execute npx tsc --watch. Actually, automating things will make your life easier, so why not add a new script to package.json?
Your script block should now look like this:
"scripts": {
"tsc": "tsc",
"watch": "tsc --watch"
},
With that in place, you should be able to start tsc in watch mode and get the compilation results right from the Terminal:
[20:41:20] Starting compilation in watch mode... [20:41:21] Found 0 errors. Watching ...
Read now
Unlock full access