A plugin to make authoring with MUI components efficient, both for humans and bundlers.
✍️ What you write | 👏 What your bundler sees |
---|---|
import {
AppBar,
List, ListItem, ListItemAction,
makeStyles
} from "@material-ui/core";
import { Add } from '@material-ui/icons'; |
import AppBar from "@material-ui/core/esm/AppBar";
import List from "@material-ui/core/esm/List";
import ListItem from "@material-ui/core/esm/ListItem";
import ListItemAction from "@material-ui/core/esm/ListItemAction";
import { makeStyles } from "@material-ui/core/esm/styles";
import Add from "@material-ui/icons/esm/Add"; |
- Get it from npm:
npm i babel-plugin-transform-mui-imports
- Put it in your Babel config:
{ "plugins": ["transform-mui-imports"] }
tried using it with next.js and got this: