how to actually Build an Angular2 App

36 views
Skip to first unread message

Patrick Caillouet

unread,
Jan 12, 2017, 2:53:33 PM1/12/17
to Angular
I'm a noob to Angular2, Node, NPM, Git but not Html/css/JS.

I was able to setup Node, NPM and use git to clone the quickstart project for Angular2... then go through the process of the "Hero Editor" tutorial. One HUGE thing I think that was left out of the tutorial is... how to actually USE what your built... Like, put it online, these seems to me like something people would probably want to know, because if not... whats the purpose?

If I take all the files for the project and put it on the web... (yes the what seems like hundreds and hundreds of files for this simple app).... it doesn't work ( like i know it shouldn't). I KNOW angular2 is suppose to compile somehow and combine all the .ts .map. js files into a bundle somehow.

So my question is... How do I actually build my "Hero Editor" demo app? How do I combine all the files and compile it into the bundle files?

Thierry Ciot

unread,
Jan 13, 2017, 11:27:23 AM1/13/17
to Angular
You can use Angular CLI tool to create bundles and then include these bundles from your page.  See CLI command ng build -prod.

Thierry

Sander Elias

unread,
Jan 13, 2017, 12:50:23 PM1/13/17
to Angular
Hi Patrick,

This answer I just posted might be helpful to you too.
Also, in case of an existing app, it might be easier to use webpack to do the bundling for production. 

Regards
Sander
Reply all
Reply to author
Forward
0 new messages