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(gatsby): fix root resolving of resources #29577

Merged
merged 13 commits into from
Feb 24, 2021
Merged

fix(gatsby): fix root resolving of resources #29577

merged 13 commits into from
Feb 24, 2021

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Feb 18, 2021

Description

Fixes url resolving by ignoring / queries but allow relative ones to be resolved by webpack.

Currently this doesn't load in the browser

background-image: url('./image.png');

This does when it's inside the /static folder or copied to the public folder.

background-image: url('/image.png');

With this PR both work.

I've also added a test to see that we don't regress in the future.

@wardpeet wardpeet added the topic: webpack/babel Webpack or babel label Feb 18, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 18, 2021
@wardpeet wardpeet marked this pull request as ready for review February 19, 2021 07:49
@wardpeet wardpeet removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 19, 2021
@wardpeet wardpeet force-pushed the fix/url-resolving branch 2 times, most recently from ef1cab5 to 3d0cc91 Compare February 22, 2021 13:56
@pieh pieh self-assigned this Feb 24, 2021
@pieh pieh merged commit affb1d6 into master Feb 24, 2021
@pieh pieh deleted the fix/url-resolving branch February 24, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: webpack/babel Webpack or babel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants