Over a million developers have joined DZone.

TypeScript in First-Class F# Web Projects

DZone's Guide to

TypeScript in First-Class F# Web Projects

Free Resource

I was recently asked about how best to use TypeScript within a pure F# web project. Currently, there are two steps that are needed to make this happen. 

1. Add the TypeScript item template by downloading and installing the latest version of the F# Web Item Templates extension from  http://visualstudiogallery.msdn.microsoft.com/f1dae7fe-1ecc-4f1b-86b5-32a2970d012a.
2. Modify your project file to allow the TypeScript files to compile to JavaScript when the project is compiled. To do this, you need to do the following:
- Edit your fsproj file. 
- Add the TypeScriptToolsVersion element and specify the appropriate TypeScript version that you have installed.
- Add 3 new commands to the BeforeBuild target.
- Save and re-open your project. You should now be good to go.
I plan to work on a solution to reduce the pain of step 2 in the near future, so stay tuned...

Published at DZone with permission of Daniel Mohl, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}