打字稿文件观察器在 JavaScript 中不起作用 [英] Typescript filewatcher not working in JavaScript
问题描述
我在 webstorm 中设置了一个 typescript filewatcher,我想用它来不断地编译对 typescript 文件的更改.该文件还使用了 jQuery.打字稿编译器没有像它应该的那样将文件更改为 javascript.编译发生得非常好,直到我在参数中添加了--module amd" - 使用javascript进行编译.所以我现在拥有的是新的 .ts 文件和旧的 .js 文件,就像我改变参数之前一样.
I have a typescript filewatcher set up in webstorm that I want to use to constantly compile changes to the typescript file. The file also uses jQuery. The typescript compiler is not changing the file to javascript as it should. The compilation happen perfectly fine until I added "--module amd" to the arguments - to compile with javascript. So what I have now is the new .ts file and the old .js file as it was before I changed the argument.
这是 ts 文件:
/// <reference path="jquery.d.ts" />
function append(parentDivId, text){
$(idSelector(parentDivId)).append(text);
}
这里是filewatcher设置,如图:
Here are the filewatcher settings are as shown:
程序:C:\Users\Me\AppData\Roaming\npm\tsc.cmd
Program: C:\Users\Me\AppData\Roaming\npm\tsc.cmd
参数:--sourcemap $FileName$ --out "--module amd"
Arguments: --sourcemap $FileName$ --out "--module amd"
推荐答案
如果你想使用 node 自带的 tsc 程序需要沿着 node
If you want use tsc that comes with node the Program needs to be along the lines of node <pathtotsc.js>
相反,我建议您使用 TypeScript SDK.演示:http://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
Instead I recommend you use the TypeScript SDK. Demo : http://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
这篇关于打字稿文件观察器在 JavaScript 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!