Skip to content

[Feature]: Support import.meta.resolve #14923

@alecmev

Description

@alecmev

🚀 Feature Proposal

import.meta.resolve is unflagged since Node.js 20.6.0.

Motivation

Currently we have to do this:

import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
require.resolve("foo");
require.resolve("bar");

When implemented, we can instead do this:

import.meta.resolve("foo");
import.meta.resolve("bar");

Example

No response

Pitch

One more step toward full ESM compatibility. Opening this issue because it doesn't appear to be tracked in #9430.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions