Nuxt/docs/content/7.bridge/1.nitro.md
Daniel Roe f2672ac230
docs: server updates/introduction (#205)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2021-06-14 21:12:00 +02:00

32 lines
743 B
Markdown

# Nitro
> It is possible to use the Nuxt3 rendering engine (Nitro) with Nuxt2 via a compatibility module.
1. Install `@nuxt/nitro` as a devDependency:
```bash
yarn add --dev @nuxt/nitro
```
1. Add `@nuxt/nitro/compat` to `buildModules` inside `nuxt.config`:
```ts [nuxt.config.js]
export default {
buildModules: [
'@nuxt/nitro/compat'
]
}
```
1. If you have selected `target: 'static'` in your `nuxt.config`, update the `build` script in package.json to be `nuxt generate`:
```json [package.json]
{
"scripts": {
"build": "nuxt generate"
}
}
```
Now, when you build your project, Nitro will generate an optimized server bundle for fast, next-generation edge rendering.