Improve SVG handling - #1990
Open
fturmel wants to merge 4 commits into
Open
Conversation
✅ Deploy Preview for codingtrain ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
fturmel
marked this pull request as ready for review
August 7, 2026 18:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I reopened the source code for the website a few days ago and noticed I had been sitting on some SVG related optimizations that were never finished/merged.
This essentially replaces the
gatsby-plugin-react-svgwith@svgr/webpackso SVGs are automatically optimized bysvgo. It's going to allow upgrading to newer React versions too, there were compat problems with that abandoned Gatsby plugin. The "*.mini.svg" files were removed, as well as some dupes.The heavy hero train SVG on the homepage is also now 95% smaller (1.6mb to 90kb), which should make the page load faster and use up less bandwidth. It's still an SVG, but the large embedded PNG image inside it was scaled down and converted to a WebP image.
(I'm going to attempt to update the project dependencies over the coming days as well, watch out for another PR soon. Latest Gatsby version should be able to run on Node 24 which is the current LTS).