One of the most frustrating things ever is wanting to try something out and having to install a million things and learn 3.14 new tools just to get something runnable in your browser.
I wrote up a minimal server and repository for a project that compiles your TypeScript down for use in a browser environment, so that people can try TypeScript if they want, without worrying about things like loaders, webpack, etc.
Dependency-free Typescript setup
This is a truly minimal, dependency-free setup that will provide the skeleton for you to:
- write your code in Typescript
- compile it for browser use
- use that compiled code in a browser environment
That's it. This server won't do anything fancy: it won't reload for you, it won't minify or uglify anything.
It will serve files for you, and that's it. You can ignore the server entirely if you want; or, if you think writing your own server sounds neat, the second half of the README is worth checking out.
There's no magic here. No Webpack, no loaders, no routing libraries necessary, etc. (If you don't know what those are, don't worry -- the point of this repository is so you don't have to.) There's nothing wrong with using those tools, but they add complexity, and they can extremely frustrating to use when all you really want…
Its only dependency is TypeScript itself. Literally. (Well, okay, Node too, but TypeScript itself uses Node, so I think that's permissible.)
If all you want is to try a basic website with TypeScript, this is perfect for that.
If you want to try writing your own server, please use this as a base if you want -- I included notes in the server files, let me know if anything is unclear! -- but if you want nothing to do with the server, you shouldn't need to mess with its code.