But we should try to find a way to optimize this again.
After that, I got a suspicion that the issue we had could be related to the order of the babel plugin. If this runs before next.js plugins, then it's good. But if next.js runs first, then this fails.
Optimizing would save ~6kb on pages where SuperJSON isn‘t needed. Since Next.js will put that into the main bundle relatively fast anyway, I‘m not really sure wether optimization is worth it. Relying on Babel order is finicky, anyway ...
In https://github.com/blitz-js/babel-plugin-superjson-next/pull/34 we removed our detection logic because it was failing.
But we should try to find a way to optimize this again.
After that, I got a suspicion that the issue we had could be related to the order of the babel plugin. If this runs before next.js plugins, then it's good. But if next.js runs first, then this fails.