Nuxt/docs/content/6.deployment/presets/99.custom.md
Daniel Roe c75c03e0bb
docs: add deployment (#211)
Co-authored-by: Alexander Lichter <manniL@gmx.net>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2021-06-14 14:31:30 +02:00

970 B

Custom build preset (advanced)

  • Allows full customization
  • This is an advanced usage pattern

Setup

You can create your own custom build 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: {
    //
  }
}

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')
  }
}