1

コードのどこかに、typescript 文字列を引数として取り、戻り時に javascript 文字列を出力する関数が欲しいです。ClearScript が提供する V8 に tsc コンパイラを配線することを考えていますが、そのことは十分に文書化されておらず、nuget パッケージの形式でショートカットを探していると思います。何かアドバイス?

4

1 に答える 1

1

typescript コンパイラは、単なるコマンド ライン実行可能ファイル tsc.exe です。これを行うには、次のようにします。

// write text to temporary .ts file ...

var startInfo = new ProcessStartInfo {;
    FileName = "\path\to\tsc.exe",
    Arguments = args   // parameters to pass to tsc, including .ts
};
Process.Start(startInfo);

// read text from newly created .js file
于 2013-10-26T19:20:30.743 に答える