Skip to content

Resolve "require" modules relative to project directory #2985

Closed
@novemberborn

Description

@novemberborn

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions