typescript-webpack-tree-shaking icon indicating copy to clipboard operation
typescript-webpack-tree-shaking copied to clipboard

Unused React Components not removed by tree shaking

Open cdeutsch opened this issue 8 years ago • 0 comments

@blacksonic any idea why tree shaking doesn't work if the class extends React.Component?

Here's a simple reproduction: https://github.com/cdeutsch/typescript-webpack-tree-shaking/commit/cc37b70629de1698f20c0d2cf3af78ccbf18abde#diff-f2a33497e4348acebe5f8fe829ffc6ffR19

Is it a bug with Babel-Minify?

Or are there side effects with extending React.Component?

As you can see V10 shows up in the prod bundle... image

Also note, I upgraded your sample to use:

cdeutsch avatar Sep 27 '17 14:09 cdeutsch