Expand Minimize

SPF229901: Client Side Web Part doesn't use optimized scripts

Client Side Web Part doesn't use optimized scripts

CheckId SPF229901
TypeName WebPartUsesOptimizedScripts
Severity CriticalError
Type Web Part Manifest

Client Side Web Parts built using the SharePoint Framework should be optimized before releasing to production. During the optimization process Client Side Web Part's code is compressed and debugging information is removed. This results in smaller files that load faster.

Optimizing Client Side Web Parts is done while building the SharePoint Framework project. An optimized build is requested using the --production flag:

$ gulp bundle --production

The output of such build is copied to the deploy folder from which is should be referenced by the package-solution Gulp task.

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.