-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to disable validation of "Default condition should be last one" #160
Comments
I personally intend to follow the spec. But this case is tricky, nodejs itself doesn't follow the spec due to reasons I don't know. For maximum compatibility, rolldown needs to follow the esbuild's behavior. |
This comment was marked as off-topic.
This comment was marked as off-topic.
The spec never mentioned the logic where "default" must be last or it should throw an error. Hence enhanced-resolve is the one not conforming to the spec. statement for being the last: https://nodejs.org/docs/v20.13.1/api/packages.html#conditional-exports should, not must. |
…e last one 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.
…e last one 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.
…e last one (#171) 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.
Related code:
oxc-resolver/src/lib.rs
Lines 1464 to 1468 in e04ca0f
The current behavior of oxc-resolver is correct based on the spec, but not flexable.
Though spec said the "default" should always come last, but nodejs actually doesn't do strong validation on it. If "default` shows , it will be matched once detecting it.
Context:
Related:
Default condition should be last one
webpack/enhanced-resolve#421The text was updated successfully, but these errors were encountered: