Some sample about how to proper add tree shaking when using popular libraries like material-ui
In this sample we are just creating a minimum code base (using just react and react-dom) and adding the needed configuration to run webpack-analyzer.
Check typescript/00 base/readme.md for more details.
This sample start from 00 Base, in this case we are going to install a popular ui library (material ui) and we are going to import components from there in way that tree shaking is not enabled (we are not importing in es6 modules mode)
In this sample we are going to use a fullpath import, to get tree shaking working.
import AppBar from 'material-ui/AppBar';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
This sample start from 01 no-treeshaking-material-ui, in this case we want to keep on using barrels imports.
We are going to install material-ui@next build that contains a es6 version folder, then create an alias on webpack.
We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
Basefactor, consultancy by Lemoncode provides consultancy and coaching services.
Lemoncode provides training services.
For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend