Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Clarification for bundlers re "import" / "require" matching #556

Closed
@guybedford

Description

@guybedford

It came up in discussion with RollupJS and Webpack implementations that the idea of "import" and "require" being not only mutually exclusive but also exhaustive may rule out some cases like asset resolutions where they want to use the same resolver to eg resolve image stylesheet imports from within a stylesheet.

In Webpack currently, @import in sass will use neither the "require" nor the "import" condition.

I was wondering how we want to clarify the Node.js guidance as we define these terms - should other resolvers always use one of these or do we relax the guidance to permit them both to be disabled, so long as they remain mutually exclusive?

Another point on this topic is what import.meta.resolve should use. Currently it will by default use the environment conditions and "import". It could be an option to relax that as well to not use the "import" condition since it is an abstract resolution operation.

I don't want to get into allowing custom condition arguments to this resolver spec ideally though, although perhaps that is where this goes? Either way does "import" as the initial starting point make sense?

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