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

Resolve "require" modules relative to project directory #2985

Closed
novemberborn opened this issue Mar 6, 2022 · 1 comment
Closed

Resolve "require" modules relative to project directory #2985

novemberborn opened this issue Mar 6, 2022 · 1 comment
Labels
bug current functionality does not work as desired help wanted scope:test-environment

Comments

@novemberborn
Copy link
Member

See #2971 (comment):

I think we should resolve relative to the project directory, likely we're trying to approximate that with resolve-cwd but the CWD doesn't have to be the project directory. I'd classify this as a bug, actually.

This is needed so that we import the expected module, without say AVA's dependencies shadowing it.

We may be able to use nodejs.org/api/module.html#modulecreaterequirefilename with the project directory and use the resolve() method on that.

@novemberborn
Copy link
Member Author

#3184 loads the module from a file inside the project, which achieves the goal of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired help wanted scope:test-environment
Projects
None yet
Development

No branches or pull requests

1 participant