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

Support query strings in imports #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnleonard3
Copy link

Typically used in a webpack environment when using the resourceQuery loader parameter: https://webpack.js.org/configuration/module/#ruleresourcequery

Typically used in a webpack environment
);
});

it('should resolve the file path with an extension that is non-standard in node', () => {
it('should resolve the file path while keeping the extension and query', () => {
Copy link
Author

Choose a reason for hiding this comment

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

This file hasn't been prettified in 2 years so I was the lucky one to make that change, but here's my first unit test asserting that a path with a query string is resolved and transformed successfully for the root path case.

);
});

it('should alias the path with its extension and query', () => {
Copy link
Author

Choose a reason for hiding this comment

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

And here's the unit test when the path is aliased and has a query string

@jnleonard3
Copy link
Author

If anyone needs this before this becomes an official part of this project, I've published it to npm as at least my organization needs this change in the meantime:
npm i @jleonardvp/babel-plugin-module-resolver

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

1 participant