On this page
· 2 min read
Vite Configuration
The build is a normal Vite project: vite.config.ts registers shared assets, Solid with SSR, pagesmithContent, and the spread pagesmithSsg plugin array.
Current config
import { defineConfig } from "vite-plus";import collections from "./content.config";import solid from "vite-plugin-solid";import { pagesmithContent, pagesmithSsg, sharedAssetsPlugin } from "@pagesmith/site/vite";export default defineConfig({ base: "/pagesmith/examples/solid", plugins: [ sharedAssetsPlugin(), solid({ ssr: true }), pagesmithContent({ collections }), ...pagesmithSsg({ entry: "./src/entry-server.tsx", contentDirs: ["./content"] }), ], build: { outDir: "../../../gh-pages/examples/solid", emptyOutDir: true, rolldownOptions: { checks: { pluginTimings: false, }, }, },});Plugin roles
sharedAssetsPlugin()— copies shared assets (for example bundled fonts) referenced from CSS into the output so production paths resolve.solid({ ssr: true })— compiles JSX insrc/entry-server.tsxfor server output (renderToString), not hydration.pagesmithContent({ collections })— readscontent.config.ts, validates frontmatter, runs the markdown pipeline, and registersvirtual:content/<collection>modules consumed by the entry....pagesmithSsg({ entry, contentDirs })— dev middleware that SSR-renders requests, and the production pipeline that callsgetRoutes/render, writes HTML, and runs Pagefind.contentDirsis what Vite watches for markdown HMR.
base and outDir
base is the public path prefix for GitHub Pages (config.base in render() prefixes internal links). outDir points at the monorepo’s gh-pages/examples/solid tree so this example can be deployed alongside other demos.