---
sidebar_label: ssr
---

# server.ssr

- **Type:** `boolean`
- **Default:** `false`

Enalbe SSR configuration.

### Boolean Type

When the value type is `boolean`, it indicates whether to enable SSR deployment mode, and `false` is not enabled by default.

```ts title="modern.config.ts"
export default defineConfig({
  server: {
    ssr: true,
  },
});
```

### Object Type

When the value type is `Object`, The following properties can be configured:

- `mode`: `string = 'string'`, use `renderToString` rendering default. onfigure 'stream' to enable streaming rendering.
- `forceCSR`: `boolean = false`, forced CSR rendering is disable by default. When configured as `true`, add `?csr=true` in URL to force CSR.
- `inlineScript`：`boolean = true`, by default SSR data will be injected into HTML as inline scripts and directly assigned to global variables. Configure as `false` to inject JSON instead of directly assigning.

```ts title="modern.config.ts"
export default defineConfig({
  server: {
    forceCSR: true,
    mode: 'stream',
    inlineScript: false,
  },
});
```
