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

743 B

Nitro

It is possible to use the Nuxt3 rendering engine (Nitro) with Nuxt2 via a compatibility module.

  1. Install @nuxt/nitro as a devDependency:

    yarn add --dev @nuxt/nitro
    
  2. Add @nuxt/nitro/compat to buildModules inside nuxt.config:

    export default {
      buildModules: [
        '@nuxt/nitro/compat'
      ]
    }
    
  3. If you have selected target: 'static' in your nuxt.config, update the build script in package.json to be nuxt generate:

    {
      "scripts": {
        "build": "nuxt generate"
      }
    }
    

Now, when you build your project, Nitro will generate an optimized server bundle for fast, next-generation edge rendering.