Building an Angular 2 + Typescript application template
2016, Aug 25
Last time I showed you a way to create a Typescript application template. Now we can use that as a starting point for an Angular 2 application.
As usual, I have created a GitHub repo with the necessary sources and the list of steps to perform. At the end of the process, we’ll get our friendly web server showing a nice “lorem ipsum” coming from an Angular2 Component .
Also in this case the core of the system is gulpfile.js which exposes a bunch of tasks:
- ‘clean’ : as the name may suggest, this task is used to clear the www folder from all the external libraries, the transpiled .js files and sourcemaps
- ‘libs’: this will copy the depencencies to a specific folder
- ‘build’: this will execute ‘clean’ and ‘libs’ and then transpile the .ts files
- ‘default’: will execute ‘build’, fire up the webserver and watch the .ts files for changes
Worth of mention is also the index.html which contains the SystemJs initialization code.
Enjoy!