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

Update webpack docs when using SVGR and asset SVG in the same project #692

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

smol-honk
Copy link
Contributor

Summary

When trying to use webpack 5's resourceQuery as defined in the previous docs, I kept getting a base64 string of the compiled react component not the svg.

This ended up erroring out all usage of import svg from 'my-svg.svg?url since it wasn't actually a base64 of the xml svg. I updated the docs with the fix I used to only have the svgr loader called when the resourceQuery is not url.

Also updated the.gitignore to ignore MacOS specific files in the future.

Test plan

The examples/webpack didn't use the resourceQuery option so the only edits were made to the documentation text. I ran the gatsby doc app locally to check that it works and reflected the change in the right spot and then linted/tested the entire repo.

@vercel
Copy link

vercel bot commented Mar 4, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/gregberge/svgr/Hs2oRUjMZaePksvHPeVSZgyDxDkr
✅ Preview: https://svgr-git-fork-smol-honk-docs-webpack-resourcequery-gregberge.vercel.app

@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #692 (1eb0f77) into main (161d1b1) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #692   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files          32       32           
  Lines         777      777           
  Branches      255      255           
=======================================
  Hits          713      713           
+ Misses         62       60    -2     
- Partials        2        4    +2     
Impacted Files Coverage Δ
packages/core/src/state.ts 86.95% <0.00%> (ø)
packages/webpack/src/index.ts 85.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 161d1b1...1eb0f77. Read the comment docs.

@brunowego
Copy link

Thanks @smol-honk! This solves an issue I'm facing.

@smol-honk
Copy link
Contributor Author

Thanks @smol-honk! This solves an issue I'm facing.

Yay! Happy to help :)

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.

3 participants