enhanced-resolve icon indicating copy to clipboard operation
enhanced-resolve copied to clipboard

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

Open suin opened this issue 10 months ago • 2 comments

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!

suin avatar Apr 25 '24 01:04 suin