How to minimize the bundle size of material ui?

Viewed 172

I've read the Material ui's article about how to import and minimize the bundle-size:

// Option 1: instead of top level imports (without a Babel plugin):
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';

// Option 2: Needs babel plugins to change below code to above code before any transformation:
import { Button, TextField } from '@material-ui/core';

The problem is no matter what option I'm using, it will increase the bundle size the same amount around 100kb! How can we fix the problem?(I'm using craco to use the babel)

0 Answers
Related