Consider supporting trailing slash exact mappings
guybedford opened this issue · 3 comments
guybedford commented
There is an old Node.js pattern whereby a require('pkg/')
import style is permitted to resolve.
if trying to support such a map in import maps via:
{
"imports": {
"pkg/": "/path/to/pkg/index.js"
}
}
the browser console gives the error:
Ignored an import map value of "a/": Since specifierKey ended in a slash, so must the address: /a.js
If such a pattern were to remain used in Node.js ES modules, it might make sense to still consider supporting these cases resolving. //cc @hiroshige-g
guybedford commented
Ah thanks, yes closing. Wdyt re progress there? I'm tempted to consider proposing Node.js ban all trailing slash resolutions otherwise for ESM.
domenic commented
Yeah, I don't think we have any new information that would change the calculus over there...