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

Consider supporting trailing slash exact mappings #257

Closed
guybedford opened this issue Sep 8, 2021 · 3 comments
Closed

Consider supporting trailing slash exact mappings #257

guybedford opened this issue Sep 8, 2021 · 3 comments

Comments

@guybedford
Copy link
Collaborator

guybedford commented Sep 8, 2021

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

@domenic
Copy link
Collaborator

domenic commented Sep 8, 2021

Dupe of #244 ?

@guybedford
Copy link
Collaborator Author

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
Copy link
Collaborator

domenic commented Sep 8, 2021

Yeah, I don't think we have any new information that would change the calculus over there...

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