I tried using ClearScript to load the TypeScript compiler in order to compile some basic TypeScript code.
Unfortunately, when executing the TypeScript compiler source I
After 4 years, using the TypeScript 2.7 Services at https://rawgit.com/Microsoft/TypeScript/master/lib/typescriptServices.js it's kind of a two-liner now:
ts.transpile
Using e.g. a ClearScript engine
in C# with TS sourcecode in the string src
this would be:
dynamic transpile = engine.Evaluate("ts.transpile");
var js = transpile(src);
// now feed the string js into a different JS engine