-
Book Overview & Buying
-
Table Of Contents
TypeScript Blueprints
By :
First, we have to setup the project. The difference with the previous chapter is that we now have to build two applications—the client side and the server side. This causes some differences with the previous setup.
We will again place our TypeScript sources in the lib directory. In that directory, we will create four subdirectories: client, server, shared, and typings. The lib/client directory will contain the client-side application and the lib/server directory will contain the server code. Codes that can be used by both the server and the client will go in lib/shared. Last but not least, lib/typings will contain type definitions for some dependencies, including NodeJS.
In lib, we create a tsconfig.json file that will contain some configuration for TypeScript. We want to compile the server-side code to es2015, so we can use some new features of TypeScript and JavaScript. The client side, however, must be compiled to es5...