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

"imports" field support #12928

Closed
guybedford opened this issue Mar 18, 2021 · 4 comments · Fixed by #12929
Closed

"imports" field support #12928

guybedford opened this issue Mar 18, 2021 · 4 comments · Fixed by #12929

Comments

@guybedford
Copy link
Contributor

guybedford commented Mar 18, 2021

Feature request

In addition to the "exports" field, Node.js also defines the "imports" field to permit private internal resolutions to simplify backtracking and local conditional resolution cases. As far as I can tell this field isn't yet supported in Webpack.

What is the expected behavior?

When writing a package.json with an "imports" field, the #private specifier resolutions should resolve through these rules analogously to the exports field.

What is motivation or use case for adding/changing the behavior?

Node.js resolver support parity.

How should this be implemented in your opinion?

It's a similar extension to the exports field and exports package "own name" resolution.

Are you willing to work on this yourself?

Possibly!

@alexander-akait
Copy link
Member

alexander-akait commented Mar 18, 2021

We already support them

@alexander-akait
Copy link
Member

@guybedford
Copy link
Contributor Author

I've posted a failing test here in #12929.

@zdm
Copy link

zdm commented Apr 18, 2021

How to make it works?
I got error

Module not found: Error: Can't resolve '#internal'

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

Successfully merging a pull request may close this issue.

4 participants