Gatsby deploy rearranges my JSX

Are you sure you’ve got everything exactly synced between netlify and your local? Differing versions of software (node, yarn, node modules) often have effects like these.

I ask this, because I do not believe “Netlify” is doing anything to this file - we do change some files at deploy, but they are not changes like the one you link (mostly related to parsing forms, and adding canonical link headers: Improved SEO with canonical link headers and injected html snippets: Snippet injection | Netlify Docs) - so this feels more like a “we ran the build and that was the output” than “we changed something after the build completed” to me, so I’m guiding you towards debugging that build.

This doc talks about best practices in syncing versions as well as how to build locally (under “What Next?”) so you can debug better: