In this tutorial i will be showing you the Angular 4 deployment basics.
Build Angular 4 Project
Run the command below from the project folder you want to compile.
You will now notice a new folder added to your project named 'dist', the loose files you have in this folder not meant to be for production.
To build Angular 4 project for production use '--prod' parameter like the command below:
ng build --prod
For production compilation the Angular 4 output files' sizes will be now smaller.
How Angular 4 production files are smaller ?
What is AOT compilation ?
AOT stands for Ahead-Of-Time compilation. Ok but what is it ? it's part of the engine which pre-build the components and the templates, AOT enhanced the overall performance by having the template and component code in the same file and figure out all the unused directives and ignore them, isn't that sweet!