Skip to content
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

Support and respect export conditions for lookupNodeModuleSubpath #218

Open
pi0 opened this issue Jan 11, 2024 · 3 comments
Open

Support and respect export conditions for lookupNodeModuleSubpath #218

pi0 opened this issue Jan 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Jan 11, 2024

Following up fix in #210, we should support conditions option for lookupNodeModuleSubpath in order to allow filtering based on them. currently the first export from flatted exports will be used to guess which might be inaccurate.

@danielroe
Copy link
Member

Here's an example reproduction: https://stackblitz.com/edit/stackblitz-starters-w3d5xq?file=index.js

@babs20
Copy link

babs20 commented Sep 28, 2024

Hello, @pi0!

I would love to contribute a PR to resolve this issue. Could you clarify what we are expecting to pass to the conditions option and what the expected behavior would be in lookupNodeModuleSubpath?

@pi0
Copy link
Member Author

pi0 commented Sep 28, 2024

@babs20 this page might explain it. Essentially when traversing the exports object, we match the first condition (from conditions array user pass) and then fallback to default if it exists. LMK if wasn't clear or just feel free to draft some progress would be happy to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants