Skip to content

import.meta.resolve is not shimmed when using --rewriteRelativeImportExtensions #61541

Description

🔎 Search Terms

"rewriteRelativeImportExtensions", "import.meta.resolve", "require.resolve", "shim", "experimental-strip-types", "experimental-transform-types"

🕗 Version & Regression Information

⏯ Playground Link

No response

💻 Code

// tsc --rewriteRelativeImportExtensions
import("./foo.ts")
import.meta.resolve("./foo.ts")

// output:
import("./foo.js")
import.meta.resolve("./foo.ts")

🙁 Actual behavior

While imports are correctly rewritten/shimmed, calls to import.meta.resolve/require.resolve are not impacted.

🙂 Expected behavior

I would expect import.meta.resolve to resolve to the same path as an import call, as per MDN Documentation.

Additional information about the issue

No response

Activity

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

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions