镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

esm: Make import.meta.resolve(…) take an options argument #31861

Description

@ExE-Boss

require.resolve(…) takes a second optional options argument, instead of a second optional parent string argument.

This differs from what's been implemented in #31032.

import.meta.resolve(…) and require.resolve(…) should both take a string and an options object, instead of one taking two strings and the other taking a string and an options object.


/cc @guybedford

Activity

  1. MylesBorins commented on Feb 19, 2020

    @MylesBorins
    Contributor

    @ExE-Boss the intent of the api is to make something that could also be implemented / standardized for browser use cases... so it is not using require.resolve as a reference API.

    There is a discussion in the import maps proposal related to this. WICG/import-maps#79

    FWIW I'm not saying that we should or should not have an options argument, more pointing towards motivation for the existing API. Part of the reason it is behind a flag is to give us time to workshop and create something that can be cross platform

  2. added
    esmIssues and PRs related to the ECMAScript Modules implementation.
    on Dec 27, 2020
  3. GeoffreyBooth commented on Jun 14, 2022

    @GeoffreyBooth
    Member

    Per #43363 we’re matching the browser standard at whatwg/html#5572.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions