|
I'm trying to create an experimental Nitro adapter for Bunny CDN, I've already created an experimental one for Astro, but I can't find any docs on actually creating a custom preset for Nitro maybe I'm looking in the wrong spot? From what I can tell the |
Replies: 1 comment
|
You are looking in the right area, but The supported surfaces I see are:
So for a local experimental Bunny adapter, I would start with an inline preset/config layer instead of trying to register a new named preset: // nitro.config.ts
import { resolve } from "node:path";
import type { NitroPreset } from "nitro/types";
const bunnyPreset = {
extends: "base-worker",
entry: resolve("./runtime/bunny"),
commands: {
preview: "bunny ...",
deploy: "bunny ...",
},
output: {
dir: "{{ rootDir }}/.output",
publicDir: "{{ output.dir }}/public",
serverDir: "{{ output.dir }}/server",
},
hooks: {
async compiled(nitro) {
// write Bunny-specific config/manifest files here
},
},
} satisfies NitroPreset;
export default defineNitroConfig({
extends: bunnyPreset,
});The important caveat is If you want If this answers the custom-preset path, please mark it as answered so other adapter authors can find it. |
You are looking in the right area, but
defineNitroPresetis an internal helper for Nitro's built-in presets, not the public extension point I would import from an external adapter package.The supported surfaces I see are:
preset: selects a known generated preset name.extends: can merge a preset/config layer, and the public config type allows an inlineNitroPreset.defaultPreset: can be a preset name or inline preset, but only as the fallback when no explicit preset / provider auto-detection wins.So for a local experimental Bunny adapter, I would start with an inline preset/config layer instead of trying to register a new named preset: