Skip to content

Unused React Components not removed by tree shaking #81

@cdeutsch

Description

@cdeutsch

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

Here's a simple reproduction:
cdeutsch@cc37b70#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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions