Navigation Menu

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

feat(node-resolve): preserve search params and hashes #487

Merged
merged 1 commit into from Jul 12, 2020

Conversation

LarsDenBakker
Copy link
Contributor

Rollup Plugin Name: @rollup/plugin-node-resolve

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers: Fixes #486

Description

This makes node-resolve preserve any search params or hashes if they were in the import path.

Code:

import foo from 'my-package?foo=bar';

Before this change it would throw, saying it can't find my-package?foo=bar'.

After this change, it gets resolved to something like:

import foo from '/absolute/file/system/path/to/my-package?foo=bar';

This would still throw as rollup tries to find this file, but a rollup plugin can set up a special load for a module with this parameter.

@shellscape
Copy link
Collaborator

@LarsDenBakker we'll give this another day or so for folks to put eyes on it before we merge.

Copy link
Contributor

@danielgindi danielgindi left a comment

Choose a reason for hiding this comment

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

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[node-resolve] Support hashes or query params in path
3 participants