From Cloudflare Worker to Static Export
So DietPy was originally deployed as a Cloudflare Worker. Everything was fine until yesterday the bundle quietly crept past the free-tier 3 MB limit, oops.
First thing I did was try to optimize my way out of it. Moved Mermaid to a dynamic client-side import, and that brought the bundle back under the limit. Cool, problem solved... or so I thought.
Then it hit me, wait:
Why am I even using a Worker for this in the first place?
DietPy doesn't have a database, no server-side rendering either. Every single page here is already static! So why was I fighting bundle limits at all.
Switched to this instead:
output: "export"
And that's it, now it's just plain static HTML sitting on Cloudflare. No more worrying about Worker bundle limits ever again :)
Good reminder honestly. Sometimes the fix isn't optimizing what you already have, it's realizing you didn't need it to begin with.