mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
f2672ac230
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
32 lines
743 B
Markdown
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.
|