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
  1. Open a terminal in rasuke-nextjs-dev.
  2. Install dependencies once:
npm install
  1. 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.com in the root layout. Offline previews fall back to system fonts.
  • ScrollSmoother — skipped automatically for prefers-reduced-motion: reduce or when window.rasukeCore.smoothScroll is disabled; the page then uses native scroll.
Quick checklist
  • Use the dev server for day-to-day work: npm run dev
  • Use npx serve out to verify the production export
  • Hard-refresh (Ctrl + F5) after a new build so cached /_next chunks do not stick
  • Keep the out/ folder intact — the HTML expects _next/ and assets/ beside it
  • If WebGL looks static, confirm the URL starts with http:// or https:// and that the browser supports WebGL
Troubleshooting
SymptomFix
Port 3000 already in useStop the other process or run npm run dev -- -p 3100
Styles look unstyled after buildThe export is being opened over file:// — serve out/ over HTTP
Tokens look staleRun npm run tokens (or restart npm run dev)
next start failsExpected with output: "export" — preview with a static server instead (see Development)