I want to be able to have inline TypeScript in an ASPX (or Razor) page that is converted to Javascript when the page compiles.
So:
<script type="text/typescript" runat="server">
...
</script>
Becomes...
<script type="text/javascript">
...
</script>
It should happen at the same point that @ or <% %> blocks are converted.
This should be possible at run time with some kind of page post-processing, but that won't generate exceptions at compile time - I want to find errors in the script at the same time as any C# code.
Ideally TypeScript intellisense and the like should work in the inline <script> block, which makes me think that this should be a VS2012 extension.
Is there any way to do this?