You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tree shaking in Angular eliminates unused modules from the final bundle file, reducing download size and improving performance. The Angular CLI uses Webpack, which supports tree shaking from version 2. Understanding tree shaking helps optimize application performance.
3
+
The Angular CLI relies on the Webpack bundler to manage and bundle your application's code. Starting from version 2, Webpack introduced full-fledged support for tree shaking. As a result, when you build your Angular application using the Angular CLI, Webpack analyzes your codebase and automatically removes any unreachable or unused code segments.
4
4
5
-
## Using Syncfusion Angular component with Tree Shaking
5
+
## Using Syncfusion with Tree Shaking
6
6
7
-
By default, Syncfusion Angular components supports Tree Shaking and it dose not require any special changes in application level.
7
+
Syncfusion Angular components seamlessly support Tree Shaking by default, eliminating the need for any special modifications at the application level. Tree Shaking is a powerful technique that reduces the size of your application's bundle by removing unused code modules. This leads to faster load times and better overall performance.
8
8
9
9
## Implementing Tree Shaking in an Angular Application
10
10
11
-
Here are the steps for enabling Tree Shaking in an Angular application,
11
+
Enabling Tree Shaking in your Angular application, especially when utilizing Syncfusion EJ2 Angular components, is a straightforward process that can significantly enhance your application's efficiency.
12
12
13
-
1. Create an Angular application with Syncfusion EJ2 Angular components as described in the [Getting Started](../getting-started/angular-cli/) documentation using the [Angular CLI](https://cli.angular.io/).
13
+
### Steps to Enable Tree Shaking
14
14
15
-
2. Run the `ng build --prod` or `ng serve --prod` command to build or serve the application with Tree Shaking enabled.
15
+
Follow these steps to enable Tree Shaking in your Angular application,
16
16
17
-
A sample code snippet that shows how to enable Tree Shaking in the `angular.json` configuration file,
17
+
1. Create an Angular Application with Syncfusion Components: Begin by setting up your Angular application with Syncfusion EJ2 Angular components. You can find detailed instructions on how to integrate Syncfusion components into your application in the [Getting Started](../getting-started/angular-cli/) documentation using the [Angular CLI](https://cli.angular.io/).
18
18
19
-
```json
19
+
2. Build or Serve with Tree Shaking: Once your application is configured with Syncfusion components, you can enable Tree Shaking by building or serving the application with production settings. Run the `ng build --configuration=production` or `ng serve --configuration=production` command to build or serve the application with Tree Shaking enabled.
20
20
21
-
"configurations": {
22
-
"production": {
23
-
"optimization": true,
24
-
"sourceMap": false,
25
-
"namedChunks": false,
26
-
"aot": true,
27
-
"extractLicenses": true,
28
-
"vendorChunk": false,
29
-
"buildOptimizer": true
30
-
}
31
-
},
32
-
33
-
```
34
-
35
-
You can enhance the user experience and boost performance in your Angular application by following the steps above and implementing tree shaking.
21
+
By adhering to these steps and integrating tree shaking into your Angular application, you can significantly enhance performance and elevate the user experience.
0 commit comments