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

Question Regarding Restriction on "#/" in Imports Field Key #416

Open
suin opened this issue Apr 25, 2024 · 1 comment
Open

Question Regarding Restriction on "#/" in Imports Field Key #416

suin opened this issue Apr 25, 2024 · 1 comment

Comments

@suin
Copy link

suin commented Apr 25, 2024

Hello,

I came across the following code snippet in the project and had a question about its implementation:

		if (key.charCodeAt(1) === slashCode) {
			throw new Error(
				`Imports field key should not start with "#/" (key: ${JSON.stringify(
					key
				)})`
			);
		}

https://github.com/webpack/enhanced-resolve/blame/a1976054344a85da8e0e1b2e1611694630e8f97b/lib/util/entrypoints.js#L594-L600

Could you please explain why there is a restriction that the imports field key should not start with "#/"? I reviewed the Node.js documentation on Subpath Imports, but I didn't find any specific mention of such a limitation.

Thank you!

@alexander-akait
Copy link
Member

Do you mean to have import "#dep/#foo"?, because it is not valid URL

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

No branches or pull requests

2 participants