Skip to content

Migrate from Vite + vite-ssg to Nuxt 4 - #6

Closed
mathhulk wants to merge 1 commit into
claude/vibrant-faraday-ux7zgr-cleanupfrom
claude/vibrant-faraday-ux7zgr-nuxt
Closed

mathhulk wants to merge 1 commit into
claude/vibrant-faraday-ux7zgr-cleanupfrom
claude/vibrant-faraday-ux7zgr-nuxt

Conversation

@mathhulk

Copy link
Copy Markdown
Collaborator

6 of 7 (stacked on the cleanup PR, so this diff shows only the framework migration). Library swaps (CSS grid, reset, Crafatar, icons, fonts) follow in the next PR. Most of the line count is bun.lock.

Why

The site was a hand-assembled stack: Vite + vite-ssg + vue-router + unhead + beasties.

  • vite-ssg's last release was in February 2026.
  • It needed a patch for an obvious bug.
  • It held @unhead/vue on v2 and beasties on 0.3.

Nuxt is the mainstream, actively maintained Vue framework. nuxt generate pre-renders the site just like before, and it opens up official modules (icons, fonts, images), which the next PR uses.

Changes

  • src/ → app/ (Nuxt 4 layout):
    • the views become file-based pages (index, campus, club);
    • App.vue becomes layouts/default.vue;
    • PageNotFound becomes error.vue;
    • components, styles and data move unchanged.
  • Page title and accent colour come from definePageMeta. The error page passes its accent to the layout.
  • experimental.prerenderErrorPages renders error.vue into 404.html at build time. Without it, Nuxt writes an empty shell that only fills in once JavaScript runs.
  • nitro.prerender.autoSubfolderIndex: false keeps club.html/campus.html, which GitHub Pages serves without a trailing-slash redirect.
  • Links use NuxtLink, which also handles external URLs and adds rel="noopener noreferrer" for new tabs. Button no longer has to choose between <a> and RouterLink itself.
  • Head tags (lang, description, theme colour, icons, manifest) move to nuxt.config.ts. Nuxt inlines component styles into each page.
  • ESLint uses @nuxt/eslint, which understands auto-imports. Slots use the # shorthand throughout. Type-checking is nuxt typecheck.
  • Removed: vite-ssg and its patch, beasties, @unhead/vue, the direct vue-router/vite/plugin-vue dependencies, and the hand-written tsconfigs and ESLint config.
  • CI now deploys .output/public.

Verification

  • From a clean bun install --frozen-lockfile, as CI runs it: lint, nuxt typecheck and nuxt generate all pass.
  • Served .output/public behind a static server that mimics GitHub Pages: 200 for /, /club and /campus, and 404 with full content for unknown paths.
  • Built with Vue's hydration-mismatch details on: no warnings, no console errors.
  • Screenshots are pixel-identical to Simplify components and fix root causes behind several workarounds #5 on /campus and the 404 page. /club differs only in the shuffled credits, and / only in the video frame.
  • Interaction checks pass:
    • mobile menu and scroll lock;
    • full screen, Java/Bedrock toggle, scroll buttons (still land at 128px);
    • credits pause on hover;
    • accent colour and <title> per page;
    • client-side navigation between pages;
    • leaving the 404 page via its buttons or the navbar (Nuxt clears the error);
    • Donate opens in a new tab with noopener noreferrer.
  • nuxt dev serves every page.

Generated by Claude Code

Nuxt replaces the hand-assembled Vite + vite-ssg + vue-router + unhead
setup with the mainstream, actively maintained Vue framework, and
`nuxt generate` pre-renders the site exactly as before.

- src/ -> app/ (Nuxt 4 layout): views become file-based pages
  (index/campus/club), App.vue becomes layouts/default.vue,
  PageNotFound becomes error.vue; components, styles and data move as-is
- Page title and accent colour come from definePageMeta; the error page
  passes its accent to the layout
- experimental.prerenderErrorPages renders error.vue into 404.html at
  build time, so unknown URLs still get real content with a 404 status
- nitro.prerender.autoSubfolderIndex: false keeps club.html/campus.html,
  served by GitHub Pages without a trailing-slash redirect
- Links use NuxtLink, which also handles external URLs (adding
  rel="noopener noreferrer" for new tabs), so Button no longer picks
  between <a>/RouterLink itself
- Head tags (lang, description, theme colour, icons, manifest) move to
  nuxt.config.ts; component styles are inlined into each page by Nuxt
- ESLint uses @nuxt/eslint (aware of auto-imports); `v-slot:` is now
  the `#` shorthand throughout; type-checking is `nuxt typecheck`
- Removed: vite-ssg and its patch, beasties, @unhead/vue (held on v2),
  direct vue-router/vite/@vitejs/plugin-vue, and the hand-written
  tsconfigs/ESLint setup
- CI deploys .output/public

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants