stealjs / steal

Gets JavaScript
https://stealjs.com
MIT License
1.37k stars 522 forks source link

Prevent running normalization on already normalized npm names #1491

Closed matthewp closed 5 years ago

matthewp commented 5 years ago

This prevents a bug caused by rollup in tree-shaking, where it will reorder dependencies. Some times it might add a dependency to a module that already shares that same dependency, but in a different version. In this scenario the logic of the npm extension will look for the module's version, and normalize incorrectly. Since the full npm name is already encoded we can skip the expensive npm normalization logic altogether. Fixes https://github.com/stealjs/steal/issues/1490