KaiHotz / react-rollup-boilerplate

Boilerplate for creating React component libraries, bundled with Rollup.js to ESM and/or CJS Modules, Storybook, Typescript
https://kaihotz.github.io/react-rollup-boilerplate/
MIT License
300 stars 67 forks source link

Does the build 'tree-shake' the components? #5

Closed jeremytenjo closed 5 years ago

jeremytenjo commented 5 years ago

Does the build 'tree-shake' the components?

brightpixels commented 5 years ago

@tenjojeremy I am guessing you are consuming this library in an application that's using webpack? If so, then webpack should be able to tree shake this library as it has es6 modules output. The important thing is that this library outputting es6 modules, and it's the job of your consuming application's bundler (e.g. webpack) to 'tree shake'.