|
1 | 1 | ---
|
2 | 2 | title: Use existing JavaScript libraries in SharePoint Framework client-side web parts
|
3 | 3 | description: Ensure that your web parts won't negatively impact the performance of SharePoint pages that they're being used on.
|
4 |
| -ms.date: 12/02/2020 |
| 4 | +ms.date: 06/13/2022 |
5 | 5 | ms.prod: sharepoint
|
6 | 6 | ms.localizationpriority: high
|
7 | 7 | ---
|
@@ -75,11 +75,11 @@ However, bundling existing JavaScript libraries with SharePoint Framework client
|
75 | 75 |
|
76 | 76 | When bundling existing JavaScript frameworks in the SharePoint Framework, all referenced scripts are included in the generated bundle file. Following the Angular example, an optimized web part bundle including Angular is over 170 KB.
|
77 | 77 |
|
78 |
| - |
| 78 | + |
79 | 79 |
|
80 | 80 | If you add another web part to your project that also uses Angular and you build the project, you get two bundle files, one for each web part, each of them being over 170 KB.
|
81 | 81 |
|
82 |
| - |
| 82 | + |
83 | 83 |
|
84 | 84 | If you add these web parts to a page, each user would download Angular multiple times, once with each web part on the page. This approach is inefficient and slows down page load time.
|
85 | 85 |
|
@@ -162,11 +162,11 @@ export default class HelloWorldWebPart extends BaseClientSideWebPart<IHelloWorld
|
162 | 162 |
|
163 | 163 | If you build your project now and take a look at the size of the generated bundle file, you notice that it's only 6 KB.
|
164 | 164 |
|
165 |
| - |
| 165 | + |
166 | 166 |
|
167 | 167 | If you add another web part to your project that also uses Angular, and you build the project again, both bundles would be 6 KB each.
|
168 | 168 |
|
169 |
| - |
| 169 | + |
170 | 170 |
|
171 | 171 | It isn't correct to assume that you've saved over 300 KB. Both web parts still need Angular and load it the first time the user visits the page where one of the web parts is placed.
|
172 | 172 |
|
|
0 commit comments