Skip to main content

Building Static Sites

Analog supports Static Site Generation when building for deployment.

To prerender pages, enable SSR, and use the prerender property to configure routes to be rendered at build time. The routes to be prerendered can be provided asynchronously also.

This also produces a server build for your application.

import { defineConfig } from 'vite';
import analog from '@analogjs/platform';

export default defineConfig(({ mode }) => ({
plugins: [
ssr: true,
static: true, // prerender pages without building an SSR server
prerender: {
routes: async () => [