Learn about Angular tree-shaking.
When a tree is shaked especially in autumn, dead leaves will fall off. In Angular context, tree shaking means shaking off unused code by Angular compiler
ngc. In other words, it means removal of dead code.
How to Enable Angular Tree Shaking
To enable Angular tree-shaking, use Angular compiler CLI
--prod flag. Thus the command to build Angular app with tree-shaking included is
ng build --prod
Angular CLI Build
--prod option description:
Thank you for reading! Support Jun
If you are preparing for Software Engineer interviews, I suggest Elements of Programming Interviews in Java for algorithm practice. Good luck!
Feel free to contact me if you have any questions.