Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alecmev opened this issue Feb 24, 2024 · 5 comments · Fixed by #14930
Closed

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

alecmev opened this issue Feb 24, 2024 · 5 comments · Fixed by #14930

Comments

@alecmev
Copy link

alecmev commented Feb 24, 2024

🚀 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.

@SimenB
Copy link
Member

SimenB commented Feb 24, 2024

PR very much welcome! #14854 might help showing where the changes should be made 🙂

@eryue0220
Copy link
Contributor

Is there any one working on this? Or could I have a try?

@CheadleCheadle
Copy link
Contributor

@eryue0220, I've spent some time on this one. I aim to create a PR either today or tomorrow, assuming everything progresses smoothly. However, if I don't, please feel free to take over!

Copy link

github-actions bot commented Apr 4, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
@SimenB
Copy link
Member

SimenB commented May 12, 2024

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants