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

Fix localRequire with package/path requests #2425

Merged
merged 3 commits into from Jan 16, 2019
Merged

Conversation

mischnic
Copy link
Member

↪️ Pull Request

Followup for #2415

💻 Examples

localRequire("cssnano/package.json") would try to install the package "cssnano/package.json"

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@mischnic mischnic mentioned this pull request Dec 17, 2018
3 tasks
}

return parts;
Resolver.getModuleParts = function(name) {
Copy link
Member

Choose a reason for hiding this comment

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

You could use the static keyword and leave this in the class. A better way might be to just extract this function as a util file, that way localRequire isn't dependent on the resolver. In v2, the resolver will be in a separate package.

Copy link
Member Author

Choose a reason for hiding this comment

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

just extract this function as a util file

Done. How should this be tested? Determining a package which is definitely not already installed by some parcel package doesn't seem very reliable.

@devongovett devongovett merged commit 6cbf2a6 into master Jan 16, 2019
@devongovett devongovett deleted the localrequire-fix branch January 16, 2019 21:35
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 this pull request may close these issues.

None yet

2 participants