Rich-Harris / agadoo

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

feat: ignore external imports #7

Closed billiegoose closed 4 years ago

billiegoose commented 5 years ago

fixes #3 Do you want this at all? Should I put it behind a flag?

p.s. I have no idea what I'm doing.

shaking tree gif

billiegoose commented 5 years ago

ping

Rich-Harris commented 4 years ago

Thanks for the PR! I finally got round to addressing this issue, albeit in a slightly different way — using Acorn to generate an AST, then checking there are no nodes that aren't of the type ImportDeclaration. It's a bit more heavy handed, but eliminates any possible edge cases.