Webpack has an awesome feature called tree shaking.
Tree Shaking basicly just cleans up the code by removing unused code, which will allow smaller bundle sizes.
This feature should work by default, but because we are using Babel, webpack wont get direct access to the imports and thus can not remove unnecessary code.
The following article gives an example on how to fix this issue.
Description
Webpack has an awesome feature called tree shaking. Tree Shaking basicly just cleans up the code by removing unused code, which will allow smaller bundle sizes.
This feature should work by default, but because we are using Babel, webpack wont get direct access to the imports and thus can not remove unnecessary code. The following article gives an example on how to fix this issue.