ava icon indicating copy to clipboard operation
ava copied to clipboard

Resolve "require" modules relative to project directory

Open novemberborn opened this issue 2 years ago • 0 comments

See https://github.com/avajs/ava/pull/2971#issuecomment-1055760695:

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 avatar Mar 06 '22 14:03 novemberborn