Last 12 weeks · 0 commits
2 of 6 standards met
I am developping library of components with rollup and I am using agadoo tool to check if it is tree shakable. Maybe this question is off the topic, but when I use the below code the library is not tree shakable. And I don't understand why. On the other hand, when I don't use the React Component, it stays tree shakable, so what's wrong with the React component?
When I run agadoo on my library, it reports that it is not tree-shakeable because it thinks the following code might have side-effects. Granted, there might be something that overrides to be different from the standard. In my code, nothing does this. Perhaps I am not seeing the side effects that this could have? Other tools allow flagging of the call using or similar syntax. Is there a way that either the tree-shakeable code could be improved or a way for me to flag this function as pure, having no side effects (presuming I am correct that there really are no side effects here)?
Hello @Rich-Harris , I love the idea of running Agadoo on our CI server to make sure the library we are building is fully tree-shakable. However, while I believe it is currently tree-shakable (we tried it with webpack 4 and made sure bundles were correctly limited to what was needed and no more), Agadoo is throwing errors I do not really understand. Here is a super simple simplification of our lib (after building): There is a bunch of components, so imagine , folders in the same vein. And here are the content of each files: With this setup, when I run the following error message is thrown: Any idea what's wrong? Is it us and our weird sub-folder organization? Or is it Agadoo? Any pointers would be great, thanks!! PS: I tried with node 8.11.4 and 10.9.0
Repository: Rich-Harris/agadoo. Description: Check whether a package is tree-shakeable Stars: 545, Forks: 17. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Open PRs: 5, open issues: 6. Last activity: 1y ago. Community health: 42%. Top contributors: Rich-Harris, Conduitry.