02 Jul, 2022
Recently we were working on a PCF control using Fluent UI, everything was fine at the development stage, but when we tried to import it into CRM it says its too heavy.
Tip 1 – Use only what is required.
You have to take care of few things while you are importing FluentUI controls in your
index.ts of PCF control.
You should be importing the controls in granular fashion – ie. import only needed controls. Otherwise
bundle.js size will be huge. Import the necessary controls using
@fluentui/react/lib/… rather than the whole
File size when importing the whole using @fluentui/react.
File size when importing the necessary controls using @fluentui/react/lib/.
Tip 2 – use production mode
We can build a component in ‘production(i.e. minified)’ mode just using a single line of code.
When the control is ready and you want to push it to the CDS environment open *.pcfproj file and look for the following part of the file:
Add the line
Save the file and use pac pcf push command to import your component to CDS. So here is what happened to the size of bundle.js:
Email Storage Made Easy: Dynamics 365 Storage Saving Tips Introduction Microsoft's latest feature allows you to migrate email descriptions from CRM…READ MORE
How to enable the enhanced email template editor in Dynamics 365? To activate the Enhanced Email Template editor for your…READ MORE
Troubleshooting Convert Rules Import Issue: Entity 'workflow' with ID Does Not Exist error in D365 Problem Statement We implemented D365 Customer…READ MORE