0

i want use typescript file like this:
<script type="text/typescript"> // ... </script>
I found this: https://www.typescriptlang.org/play/index.html . This can compile typescript. Which is this compiler? I guess this is monaco i tried it but gives Uncaught TypeError: editor.getModel(...).getMode(...).getEmitOutput is not a function(…) Is there compiler? Sorry for my bad English. Edit: I found compilers. But their typescript versions is old.

3

1 Answer 1

0

This is a version I wrote that directly uses the version from Microsoft/TypeScript/master so it always stays up to date: https://github.com/basarat/typescript-script

<script type="text/typescript">
    setTimeout(()=>console.log('hello'));
</script>

You can even point ts to any other TypeScript version you might have and it will work fine 🌹

Sign up to request clarification or add additional context in comments.

1 Comment

I tried this. Can you look this issue, please?: github.com/basarat/typescript-script/issues/2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.