Nuxt/docs/content/3.docs/8.deployment/99.presets/custom.md
Daniel Roe 1a39eff502
docs: update migration guide for nuxt 3 (#3819)
Co-authored-by: Dan Pastori <dan@521dimensions.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-03-30 19:32:30 +02:00

1.1 KiB

Custom build preset (advanced)

Get full control of Nuxt Nitro output to deploy on any kind of hosting platform.

::list{type=info}

  • Allows full customization
  • This is an advanced usage pattern ::

::alert{icon=IconPresets} Back to presets list. ::

Setup

You can create your own custom-built preset. See the provided presets for examples.

Inline preset definition

You can define everything that a custom preset would configure directly in the Nitro options:

export default {
  nitro: {
    // preset options
  }
}

Reusable preset

You can also define a preset in a separate file (or publish as a separate npm package).

import type { NitroPreset } from '@nuxt/nitro'

const myPreset: NitroPreset = {
  // Your custom configuration
}

export default myPreset

Then in your nuxt.config you can specify that Nitro should use your custom preset:

import { resolve } from 'path'

export default {
  nitro: {
    preset: resolve(__dirname, 'my-preset')
  }
}