Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Office ui fabric - bundle size too big

I'm new to PCF/Webpack so I hope I'm missing something really simple.

I'm building a control which is a wrapper around office-ui fabric control (rating).

All works fine but even if I'm doing production build the resulting bundle is over 1mb (in development mode it's >4mb).

Despite the fact that I'm only importing few modules from office-ui fabric:

import  {RatingRatingSizefrom 'office-ui-fabric-react'
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
it seems to be bundling all possible modules:
any advice on what might be wrong?
Community Support
Community Support

Hi @Geosm ,

Could you please share a bit more about your scenario?

Do you mean that all related modules would be imported when you use import operator witihin your .ts file?


Please check if you have attached a lot of web resources/external resoueces within your Custom Component project.


If you could provided more details about your scenario, we could provide a proper workaround for you.


Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft 

see for example tutorial project from @AndrewButenko :

The bundle size would be > 4mb (dev) and > 1mb (prod).

It has only few lines of code & dependency on office-ui fabric.

I have exactly same problem in my project.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,171)