oxc-project / oxc-resolver

Rust version of webpack/enhanced-resolve
https://oxc.rs/docs/guide/usage/resolver.html
MIT License
122 stars 18 forks source link

feat!: remove the constraint on packages exports `default` must be the last one #171

Closed Boshen closed 4 months ago

Boshen commented 4 months ago

closes #160

The spec never mentioned the logic where "default" must be last or it should throw an error.

https://nodejs.org/api/esm.html#resolution-and-loading-algorithm

enhanced-resolve took the meaning from https://nodejs.org/docs/v20.13.1/api/packages.html#conditional-exports

"This condition should always come last."

This statement is not part of the specification, it is a recommendation.

codspeed-hq[bot] commented 4 months ago

CodSpeed Performance Report

Merging #171 will not alter performance

Comparing esm-exports-last (10110b2) with main (e1713c5)

Summary

✅ 2 untouched benchmarks

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.87%. Comparing base (e1713c5) to head (c404bfc).

:exclamation: Current head c404bfc differs from pull request most recent head 10110b2

Please upload reports for the commit 10110b2 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #171 +/- ## ========================================== - Coverage 96.89% 96.87% -0.02% ========================================== Files 11 11 Lines 2283 2275 -8 ========================================== - Hits 2212 2204 -8 Misses 71 71 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.