microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

Q: TypeScript ? is it possible #86

Closed grahamehorner closed 6 years ago

grahamehorner commented 6 years ago

I’m not sure if want I’m considering is at all possible, I’m wondering if ChakraCore can be used to run compiled TypeScript or even run the TypeScript compile from source on TypeScript files from within C# ?

liminzhu commented 6 years ago

You can't run .ts with ChakraCore but compiled TypeScript is just JavaScript so you can run it if you target a ES version ChakraCore supports (I think unless TS would output ES2018 this shouldn't be a concern for the latest ChakraCore).

grahamehorner commented 6 years ago

✊️🤔so in theory you could compile the typescript compiler source and run this inside of ChakraCore to compile TypeScript files ? 🤔🤟🤞

liminzhu commented 6 years ago

I think this is how https://www.nuget.org/packages/Microsoft.TypeScript.Compiler/2.7.1 works.