Auto-Build TypeScript Project in Visual Studios Code 2015 -


i starting out in type script, , using new visual studios code ide. facing issue can either use visual studios type script plug-in, , run javascript files using node. won't build js file automatically when ts file saved. uninstalled plugin, , installed typescript according video:

https://egghead.io/lessons/typescript-typescript-up-and-running-in-seconds

now can have 1 ts file built using --watch option, how accomplish auto building multiple .ts files when move on more complex projects require it?

also best way write typescript using visual studios code ide? i'm not huge fan of set because have have terminal open watch single ts file (which can mean bunch of windows required watch each file, , terminal open run program.

i'm not sure whether use visual studio code or visual studio 2013. assume it's vs code (if it's not, consider switching. vs code good!).

now i'll quote myself another answer.

you can build commands:

create simple tsconfig.json watch = true (this instruct compiler watch compiled files):

{     "compileroptions": {         "target": "es5",         "out": "js/script.js",         "watch": true     } } 

note files array omitted, default *.ts files in subdirectories compiled.

configure task (ctrl+shift+p -> configure task runner):

{     "version": "0.1.0",     "command": "tsc",     "showoutput": "silent",     "isshellcommand": true,     "problemmatcher": "$tsc" } 

now press ctrl+shift+b build project. see compiler output in output window (ctrl+shift+o).

see 1 of projects more info: tsconfig.json, .settings/tasks.json.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -