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

filter import map entries and handle relative exports from dependency entry points #749

Merged

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Oct 4, 2021

Related Issue

resolves #748 and #773 to fix issues observed while integrating MWC - ProjectEvergreen/greenwood-getting-started#42

Just a quick and dirty approach that seemed to work and passed all the tests, not sure if the best, so just putting in a draft for now. Should also look at the foundation issue as well in the linked PR.

Summary of Changes

  1. Filter out entries that aren't file paths
  2. Handle relative export paths from dependency entry points

TODO

  1. Add specs and clean up console logging
  2. Little more manual testing to verify this is sufficient and validate full MWC interop

@thescientist13 thescientist13 added bug Something isn't working CLI labels Oct 4, 2021
@thescientist13 thescientist13 self-assigned this Oct 4, 2021
console.debug('entryPath', entryPath);
console.debug('entry', entry);
if (path.extname(entryPath) !== '') {
importMap[entry] = entryPath;
Copy link
Member Author

@thescientist13 thescientist13 Oct 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this is just the same line, no need for the conditional? I think maybe it was supposed to be

if (path.extname(entryPath) !== '') {
    entryPath = `${entryPath}.js`;
}

@thescientist13 thescientist13 changed the title filter import map entries filter import map entries and handle relative exports from dependency entry points Oct 17, 2021
@thescientist13 thescientist13 marked this pull request as ready for review October 17, 2021 18:37
@thescientist13 thescientist13 merged commit 36cd1d9 into master Oct 20, 2021
@thescientist13 thescientist13 deleted the bug/issue-748-duplicate-package-entries-in-import-map branch October 20, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI
Projects
None yet
1 participant