nitro icon indicating copy to clipboard operation
nitro copied to clipboard

feat: resolve actual subpaths before guessing

Open danielroe opened this issue 1 year ago • 4 comments

🔗 Linked issue

❓ Type of change

  • [ ] 📖 Documentation (updates to the documentation or readme)
  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [x] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This resolves actual subpaths rather than guessing, so (for example) node-fetch-native/dist/polyfill.mjs can correctly be resolved to node-fetch-native/polyfill and back again.

📝 Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

danielroe avatar Sep 21 '22 21:09 danielroe

Codecov Report

Merging #527 (ee6ea64) into main (2049def) will decrease coverage by 0.33%. The diff coverage is 55.88%.

@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   63.96%   63.62%   -0.34%     
==========================================
  Files          55       55              
  Lines        3644     3665      +21     
  Branches      400      406       +6     
==========================================
+ Hits         2331     2332       +1     
- Misses       1299     1317      +18     
- Partials       14       16       +2     
Impacted Files Coverage Δ
src/rollup/plugins/externals.ts 82.22% <55.88%> (-6.12%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 21 '22 21:09 codecov[bot]

If you like this approach we can also extract into a mlly util.

danielroe avatar Sep 23 '22 13:09 danielroe

A refactor to mlly would be nice idea for reverse resolving subpaths 👍🏼

pi0 avatar Sep 26 '22 10:09 pi0

extracted:

  • [ ] https://github.com/unjs/pkg-types/pull/47
  • [ ] https://github.com/unjs/mlly/pull/89

danielroe avatar Sep 26 '22 10:09 danielroe