Local Preview
Rasuke is a static-export Next.js project: npm run build writes a fully self-contained site to out/. Because every asset URL is absolute (/_next/…, /assets/…), the export must be served over HTTP — double-clicking the generated HTML over file:// will not load styles, scripts, or WebGL textures.
Development server
- Open a terminal in
rasuke-nextjs-dev. - Install dependencies once:
npm install
- Start Next.js:
npm run dev
Open http://localhost:3000. predev runs npm run tokens first, so CSS custom properties always match tokens/tokens.json. Pages hot-reload as you edit components, SCSS, or JSON data.
Preview the production export
npm run build npx --yes serve out
Open the URL printed by serve (usually http://localhost:3000, or pass -l 4000 to change the port). Any static server works — for example python -m http.server 8080 --directory out.
Deploy to Cloudflare Pages
- Build command:
npm run build - Output directory:
out - Node version: 20 (or 18.18+)
No server runtime is required — the export is plain HTML, CSS, JS, and assets. The same output works on Netlify, Vercel (static), S3, or any shared host.
What needs a normal origin
- WebGL — grid deformation, hover deformation, and the Showcase 2 carousel sample image textures. Local files under
file://are treated as insecure by some browsers, so always use a local HTTP server. - Google Fonts — Host Grotesk, DM Sans, and Bonheur Royale are requested from
fonts.googleapis.comin the root layout. Offline previews fall back to system fonts. - ScrollSmoother — skipped automatically for
prefers-reduced-motion: reduceor whenwindow.rasukeCore.smoothScrollis disabled; the page then uses native scroll.
Quick checklist
- Use the dev server for day-to-day work:
npm run dev - Use
npx serve outto verify the production export - Hard-refresh (
Ctrl + F5) after a new build so cached/_nextchunks do not stick - Keep the
out/folder intact — the HTML expects_next/andassets/beside it - If WebGL looks static, confirm the URL starts with
http://orhttps://and that the browser supports WebGL
Troubleshooting
| Symptom | Fix |
|---|---|
| Port 3000 already in use | Stop the other process or run npm run dev -- -p 3100 |
| Styles look unstyled after build | The export is being opened over file:// — serve out/ over HTTP |
| Tokens look stale | Run npm run tokens (or restart npm run dev) |
next start fails | Expected with output: "export" — preview with a static server instead (see Development) |