Skip to content

Some sample about how to proper add tree shaking when using popular libraries like material-ui

License

Notifications You must be signed in to change notification settings

Lemoncode/treeshaking-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

treeshaking-samples

Some sample about how to proper add tree shaking when using popular libraries like material-ui

Samples

Typescript

00 base

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.

01 No Treeshaking material ui

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)

02 Treeshaking material ui

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';

03 Barrels

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.

About Basefactor + Lemoncode

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

About

Some sample about how to proper add tree shaking when using popular libraries like material-ui

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •