From 48d0c4e47de1b4ddadbdd06946923f8d60de84f1 Mon Sep 17 00:00:00 2001 From: Owen Rees Date: Wed, 3 Jun 2026 20:19:00 +0200 Subject: [PATCH] prerender html and generate sitemap --- src/config.ts | 2 ++ vite.config.ts | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/config.ts b/src/config.ts index 3b6eb00..7730131 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,2 +1,4 @@ +export const HOST_URL = "https://chess-scribe.org"; + export const GITHUB_URL = "https://github.com/therealowenrees/chess-scribe-website"; diff --git a/vite.config.ts b/vite.config.ts index 5a46a66..8e1df5c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,21 +1,31 @@ -import { defineConfig } from 'vite' -import { devtools } from '@tanstack/devtools-vite' +import tailwindcss from "@tailwindcss/vite"; +import { devtools } from "@tanstack/devtools-vite"; -import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import { tanstackStart } from "@tanstack/react-start/plugin/vite"; -import viteReact from '@vitejs/plugin-react' -import tailwindcss from '@tailwindcss/vite' -import { nitro } from 'nitro/vite' +import viteReact from "@vitejs/plugin-react"; +import { nitro } from "nitro/vite"; +import { defineConfig } from "vite"; +import { HOST_URL } from "#/config.ts"; const config = defineConfig({ - resolve: { tsconfigPaths: true }, - plugins: [ - devtools(), - nitro({ rollupConfig: { external: [/^@sentry\//] } }), - tailwindcss(), - tanstackStart(), - viteReact(), - ], -}) + resolve: { tsconfigPaths: true }, + plugins: [ + devtools(), + nitro({ rollupConfig: { external: [/^@sentry\//] } }), + tailwindcss(), + tanstackStart({ + prerender: { + enabled: true, + crawlLinks: true, + }, + sitemap: { + enabled: true, + host: HOST_URL, + }, + }), + viteReact(), + ], +}); -export default config +export default config;