Skip to content

Add conditions to require.resolve options #34901

Closed
@wclr

Description

@wclr

There is PR was implemented to support custom user --conditions
#34637

I wonder why not add this param to require.resolve options, which now contains only paths, this would allow using require in some custom resolution scenarios, where it is not possible to use cli flag.

But also probably it should not fully mimic --conditions which still puts leaves require and node conditions preferable, but this option should allow overriding the full list of the used condition while resolution.

@guybedford

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.moduleIssues and PRs related to the module subsystem.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions