Skip to content

Respect "exports" field in "package.json" #9509

@mdreizin

Description

@mdreizin

Feature request

What is the expected behavior?

It would be nice if webpack respects "exports" filed defined in package.json and follow a new resolution strategy.

What is motivation or use case for adding/changing the behavior?

This feature is just landed in node@12.7.0 (see proposal-pkg-exports).

How should this be implemented in your opinion?

  1. Read "exports" filed and create resolve.alias map internally (ie if resolve.useExports = true is turned on) using proposed resolution strategy.

  2. Allow to specify resolve.mainFields = ['exports'] and check for this reserved keyword. If it is found then apply proposed resolution strategy.

Are you willing to work on this yourself?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions