astro/.changeset/wet-readers-join.md
Emanuele Stoppa 459b5bd05f
feat: SSR split mode (#7220)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-06-21 13:32:20 +01:00

776 B

astro
minor

Shipped a new SSR build configuration mode: split. When enabled, Astro will "split" the single entry.mjs file and instead emit a separate file to render each individual page during the build process.

These files will be emitted inside dist/pages, mirroring the directory structure of your page files in src/pages/, for example:

├── pages
│   ├── blog
│   │   ├── entry._slug_.astro.mjs
│   │   └── entry.about.astro.mjs
│   └── entry.index.astro.mjs

To enable, set build.split: true in your Astro config:

// src/astro.config.mjs
export default defineConfig({
    output: "server",
    adapter: node({
        mode: "standalone"
    }),
    build: {
        split: true
    }
})