Skip to content

Commit

Permalink
[docs] Use @material-ui/core in the guide
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and Joe Shelby committed Jul 14, 2018
1 parent 042b229 commit 5ca1070
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
The bundle size of Material-UI is taken very seriously, so
[size-limit](https://github.com/ai/size-limit) is used to prevent introducing any size regression.
The size of the bundle is checked at each commit:
- When importing **all the components**. This lets us spot any [unwanted bundle size increase](https://github.com/mui-org/material-ui/blob/master/.size-limit.js#L24).
- When importing **a single component**. This lets us estimate [the overhead of our core dependencies](https://github.com/mui-org/material-ui/blob/master/.size-limit.js#L30). (styling, theming, etc.: ~20 kB gzipped)
- When importing **all the components**. This lets us spot any [unwanted bundle size increase](https://github.com/mui-org/material-ui/blob/master/.size-limit.js#L30).
- When importing **a single component**. This lets us estimate [the overhead of our core dependencies](https://github.com/mui-org/material-ui/blob/master/.size-limit.js#L24). (styling, theming, etc.: ~18 kB gzipped)

## How to reduce the bundle size?

Expand All @@ -21,7 +21,7 @@ You have couple of options to overcome this situation:
You can import directly from `material-ui/` to avoid pulling in unused modules. For instance, instead of:

```js
import { Button, TextField } from 'material-ui';
import { Button, TextField } from '@material-ui/core';
```

use:
Expand All @@ -40,7 +40,7 @@ For example, the `Tabs` component is a public module while `TabIndicator` is pri
Another option is to keep using the shortened import like the following, but still have the size of the bundle optimized thanks to a **Babel plugin**:

```js
import { Button, TextField } from 'material-ui';
import { Button, TextField } from '@material-ui/core';
```

Pick one of the following plugins:
Expand Down

0 comments on commit 5ca1070

Please sign in to comment.