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"] }
@cozuya @azz0r - thanks for the reports! I've just updated the gist and published
babel-plugin-transform-mui-imports@0.2.0
that fixes both issues.