Rich-Harris / agadoo

Check whether a package is tree-shakeable
MIT License
535 stars 17 forks source link

Unexpected failure #4

Open bvaughn opened 6 years ago

bvaughn commented 6 years ago

Cool project idea. 😄

I tried plugging it into one of my React libs this morning and noticed a failure that I didn't expect. I reduced to the following case in case you're interested:

✓ This passes:

var Foo;
Foo = function (props) {
};
export { Foo };

✓ This passes:

var Foo = function (props) {
};
Foo.defaultProps = {
};
export { Foo };

✘ This fails:

var Foo;
Foo = function (props) {
};
Foo.defaultProps = {
};
export { Foo };
Andarist commented 5 years ago

@bvaughn This is a rollup issue, I've just reported it over there - https://github.com/rollup/rollup/issues/2562

Just a note - webpack & uglifyJS would be able to remove only the first one.

y-nk commented 4 years ago

same here with other (private) libraries...