Basically it's enough to
src/index.js
to build/index.es.js
module
and jsnext:main
entries to package.json
that will target this fileSo webpack 2 / rollup users can import components as we did it at beginning
import {Dialog, FlatButton, TextField, SelectField} from 'material-ui'`
And don't worry about bundle size
cc: @nathanmarks , @oliviertassinari i can create pr later today, if you're interested
@umidbekkarimov That would definitely be a great addition! I have never played with it. I would love to see a PR 馃憤 .
Hey guys has anyone gotten this to work? I'm having the same issue as Dan here, in a create-react-app. create-react-app uses Webpack 2, so I'm assuming this should be working out of the box. You can respond here, but I'm sure Dan would appreciate a response as well!
https://github.com/facebookincubator/create-react-app/issues/2748
Hi, I've been trying to setup material-ui@next with tree shaking but can't seem to make it work. I've tried both create-react-app
and setting up a project with webpack
(v4). In short,
import Button from 'material-ui/Button' // this works
but
import { Button } from 'material-ui' // this does not
Is there a sample project or somewhere I can see how to set this up with tree shaking since I think I'm doing something wrong.
@divyanshu013 I got the same problem
Side note, Parcel has been working on an experimental support for tree shaking. It seems to work out of the box with Material-UI. To be confirmed.
Most helpful comment
Hi, I've been trying to setup material-ui@next with tree shaking but can't seem to make it work. I've tried both
create-react-app
and setting up a project withwebpack
(v4). In short,but
Is there a sample project or somewhere I can see how to set this up with tree shaking since I think I'm doing something wrong.