diff --git a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md index 03d4e5e19010db..e77d440ff4c17c 100644 --- a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md +++ b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md @@ -194,6 +194,26 @@ Modify your `package.json` commands: } ``` +If you are using Next.js >= v13.1, you can make use of their [Modularize Imports](https://nextjs.org/docs/advanced-features/compiler#modularize-imports) feature. +This does not require adding Babel configuration, so you can still use [SWC](https://nextjs.org/docs/advanced-features/compiler#why-swc) if you prefer. + +Create a `next.config.js` file in the root directory: + +```js +/* next.config.js */ +/** @type {import('next').NextConfig} */ +const nextConfig = { + ... + modularizeImports: { + '@mui/icons-material': { + transform: '@mui/icons-material/{{member}}' + } + } +} + +module.exports = nextConfig +``` + Enjoy significantly faster start times. #### 2. Convert all your imports