I'm having an issue with my bundle size, my project is using @material-ui core components as well as mui-datatables. I'm working on shrinking my bundle size, but noticed that the entire esm library for @material-ui/core is getting bundled. I tracked down what is importing the @material-ui/core/esm/index.js module (all the components) and it was mui-datatables. This is happening because the import { Paper, Table as MuiTable, Tooltip as MuiTooltip } from '@material-ui/core'; in mui-datatables/src/MUIDataTable.js is a top-level import and without tree-shaking, the entire MUI component base is pulled into the bundle.
If you think the change is allowable, I can create a PR for it.
Thanks for making the change! How often are changes made to the main product? Just curious when we can expect to see this in mui-datatables npm registry.
I'm having an issue with my bundle size, my project is using @material-ui core components as well as mui-datatables. I'm working on shrinking my bundle size, but noticed that the entire esm library for @material-ui/core is getting bundled. I tracked down what is importing the @material-ui/core/esm/index.js module (all the components) and it was mui-datatables. This is happening because the
import { Paper, Table as MuiTable, Tooltip as MuiTooltip } from '@material-ui/core';
inmui-datatables/src/MUIDataTable.js
is a top-level import and without tree-shaking, the entire MUI component base is pulled into the bundle.If you think the change is allowable, I can create a PR for it.
Expected Behavior
The @material-ui/core docs say that Library Authors should use path imports like this:
Current Behavior
Currently, in
mui-datatables/src/MUIDataTable.js
, the @material-ui/core components are imported from the top level, like this:Your Environment
The text was updated successfully, but these errors were encountered: