aussie1984 aussie1984 - 1 year ago 108
TypeScript Question

How can I launch node to run a .ts file from intellij?

I have a project set up with intellij IDEA happily compiling .ts typescript files to .js ES6 files. The .js files are being dumped neatly next to the .ts files.

directory tree

I'd like to the able to run the .ts files in node.js just like I can with the .js files. Eg using CMD+SHIFT+F10 on .ts intellij will launch node .js (after running the typescript compiler). After each file edit it feels awkward having to remember to open the .js version before running the file I just edited.

The equivalent experience for a java programmer would be navigating to the .class version of a unit test to execute the edited .java file.

Is this just a missing feature in intellij/webstorm or am I missing something?

Answer Source

There is no such feature, as there is no generic way to find the generated file from original one - there are dozens (actually - unlimited) ways to transform them. You can resolve original file from generated one using sourcemaps, but not vice versa. Anyway, please vote for WEB-25389

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download