Expand Minimize

SPF229802: Don't include the same modules in multiple bundles

Don't include the same modules in multiple Client Side Web Part bundles

CheckId SPF229802
TypeName DontIncludeSameModulesInMultipleBundles
Severity CriticalWarning
Type BundlesStats

By default, when you require modules in your SharePoint Framework Client Side Web Part, unless specified otherwise, these modules will be included in your Web Part's bundle. As a result, if you built two Web Parts using jQuery, your users will be downloading jQuery twice - one for each Web Part.
A better approach would be to make a separate bundle for jQuery, and other modules shared among multiple Web Parts, and reference that bundle from your Web Parts. Such bundles are commonly referred to as Dll bundles. Using Dll bundles your users would download the shared resources only once. Other Web Parts, using the same resources, could benefit of the Dll bundles already cached in their browser.

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.