Search This Blog

Thursday, November 22, 2018

Creating an Angular app With Angular CLI

1. Generate a minimalistic app with the inline template and styles with the following Angular CLI command:

ng new hello-world --minimal

2. Make a production build (it performs the AoT compilation by default):

ng build -prod

3. The npm package serve is a small web server that can gzip static files on the fly. Install it globally:

npm install serve -g

4. Change to the dist directory where the application bundles were generated and serve the app (it'll run on port 5000 by default):

serve .