admin管理员组文章数量:1399907
I'd like to run the TypeScript piler within a website in order to build something like the playground on TypeScript's website TypeScript Playground.
In opposite of running tsc on the server side, I'd like to run pile it directly within JS. I've looked for any similar posts here and any description within the TypeScript language specification, but I can't find any information on that.
I'd like to run the TypeScript piler within a website in order to build something like the playground on TypeScript's website TypeScript Playground.
In opposite of running tsc on the server side, I'd like to run pile it directly within JS. I've looked for any similar posts here and any description within the TypeScript language specification, but I can't find any information on that.
Share Improve this question edited Jan 29, 2013 at 16:23 sepp2k 371k56 gold badges681 silver badges684 bronze badges asked Jan 29, 2013 at 16:23 Thorsten HansThorsten Hans 2,68320 silver badges21 bronze badges 1- 1 possible duplicate of TypeScript Web-Based IDE - hopefully that will answer your question. – Fenton Commented Jan 29, 2013 at 17:06
3 Answers
Reset to default 2The typescript piler is written in Typescript, so you can load the piler (typescript.js) into your browser. But bare in mind that it is slightly heavy (roughly 250 KB).
There's some documentation on the TS Compiler API and there's also typestring - a wrapper that is still intended for use in NodeJS, but you can use it as a starting point.
Yes, it's possible to use TypeScript piler in the browser without any hack. Checkout my examples playground and monaco-editor demos in this answer: TypeScript Web-Based IDE
本文标签: javascriptHow to run TypeScript compiler within a websiteStack Overflow
版权声明:本文标题:javascript - How to run TypeScript compiler within a website - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744236692a2596588.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论