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

Allows for query params in SVG import statements #50

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

Conversation

romellem
Copy link

Gatsby's out-of-the-box config matches the following import statements:

import someIcon from './some-icon.svg';
import someOtherIcon from './some-other-icon.svg?key=value';

That is, you can import file.svg?query-params-here and it'll be matched, even though that module doesn't strictly end in .svg.

To keep that same functionality, we just need to adjust our test regular expression to more closely match what Gatsby previously had set.

This is useful if you are using things like svg-transform-loader.

Gatsby's out-of-the-box config matches the following import statements:

    import someIcon from './some-icon.svg';
    import someOtherIcon from './some-other-icon.svg?key=value';

That is, you can import `file.svg?query-params-here` and it'll be matched, even though
that module doesn't strictly end in `.svg`.

To keep that same functionality, we just need to adjust our `test`
regular expression to more closely match what Gatsby previously had set.
@coreyward
Copy link
Collaborator

Can you elaborate on what including query parameters here does given that this plugin doesn't do anything with them?

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.

2 participants