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

Subpath folder mapping is deprecated #25

Closed
dmail opened this issue Feb 4, 2021 · 1 comment · Fixed by #26
Closed

Subpath folder mapping is deprecated #25

dmail opened this issue Feb 4, 2021 · 1 comment · Fixed by #26

Comments

@dmail
Copy link
Member

dmail commented Feb 4, 2021

Subpath folder mappings is deprecated and should be replaced with subpath patterns.

https://nodejs.org/dist/latest-v15.x/docs/api/packages.html#packages_subpath_patterns
https://nodejs.org/dist/latest-v15.x/docs/api/packages.html#packages_subpath_folder_mappings

image

There is no pattern equivalent in the importmap spec (for now?) as explained in WICG/import-maps#232.

This repository could detect the presence of * in exports field and try to do conversion when possible

{
  "exports": {
    "./features/*": "./features/*" 
  }
}

Can be converted into importmap (just removing the *)

{
  "imports": {
    "./features/": "./features/"
  }
}

However

{
  "exports": {
    "./features/*": "./features/*.js" 
  }
}

Cannot be converted to import map, it would be ignored and some console.warn would explain why.

@dmail
Copy link
Member Author

dmail commented Feb 23, 2021

Done, in the end the console.warn is no longer relevant because we support the * notation to add extension since the source files gets parsed to add extension.

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

Successfully merging a pull request may close this issue.

1 participant