browserify / common-shakeify

browserify tree shaking plugin using `common-shake`
https://www.npmjs.com/package/common-shakeify
MIT License
105 stars 18 forks source link

Use .index/.indexDeps for module resolution #30

Closed goto-bus-stop closed 5 years ago

goto-bus-stop commented 5 years ago

Based on @laduke's test case.

When using -r, the row.file property doesn't contain a full file path, while row.deps does. So it was possible that we'd look up a full file path but it was never added to the relevant Map. (this should probably be addressed in browserify too!)

row.index and row.indexDeps do reliably match, so we can use those instead. common-shake accepts integers as module names so everything is fine.

Fixes https://github.com/browserify/common-shakeify/issues/21 Fixes https://github.com/browserify/common-shakeify/issues/29