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

Resolving against an arbitrary directory #2163

Closed
bebraw opened this issue Nov 24, 2016 · 4 comments
Closed

Resolving against an arbitrary directory #2163

bebraw opened this issue Nov 24, 2016 · 4 comments

Comments

@bebraw
Copy link

bebraw commented Nov 24, 2016

Do you want to request a feature or report a bug?

feature

What is the current behavior?

Jest resolves against package main. There's a browser boolean that allows changing the resolution mechanism against the browser field, but I don't want to set that.

What is the expected behavior?

I believe it would be useful to have a more generic resolution mechanism included. Designed right, you could eliminate the current browser field with something more powerful. I would go with a field like this:

  • resolveTo: <array> - Defaults to ["main"]. If set to ["src/", "main"] (clearly a path since there's a slash) it would try to resolve against src/ within package directory before using main as a fallback. This deprecates browser: <boolean>.
@thymikee
Copy link
Collaborator

thymikee commented Dec 9, 2016

I'm not sure if I follow, but isn't the modulePaths what you're looking for?

@bebraw
Copy link
Author

bebraw commented Dec 11, 2016

modulePaths would work but then I would have to spell out each path of a monorepo separately and maintain them by hand.

It would be enough if it was possible change resolution during development so that it would resolve against source over package.json main. browser boolean does that, but it's a little limited.

@cpojer
Copy link
Member

cpojer commented Feb 25, 2017

This will be solved through #2925, closing as duplicate.

@cpojer cpojer closed this as completed Feb 25, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants