The Tree Shaking process basically reduces the download size of an application over network.
This article provides the details on what Tree Shaking is and how it works in an Angular application.
Tree Shaking is a way to remove unused modules from the final bundle file of the application. Angluar CLI by default uses WebPack bundler for bundling the script files which supports Tree Shaking from WebPack2.
Latest bundlers, compines the complete application scripts into single bundle file. The bundle file dose not contain any export and supports the removed of unused code.
By default, Syncfusion Angular components supports Tree Shaking and it dose not require any special changes in application level.
The following steps explains how to run Tree Shaking in an Angular Application.
ng build --prod
or ng serve --prod
command to build or serve the application with Tree Shaking enabled.