diff --git a/src/package.json b/src/package.json index f2ab648b8b..0d1822a37e 100644 --- a/src/package.json +++ b/src/package.json @@ -32,6 +32,7 @@ }, "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.1", + "@netlify/functions": "^0.4.1", "@nuxt/devalue": "^1.2.5", "@nuxt/kit": "^0.2.0", "@nuxt/un": "^0.1.1", diff --git a/src/presets/netlify.ts b/src/presets/netlify.ts index b1e2919426..03586b2ac0 100644 --- a/src/presets/netlify.ts +++ b/src/presets/netlify.ts @@ -11,3 +11,8 @@ export const netlify: NitroPreset = extendPreset(lambda, { '_redirects' ] }) + +// eslint-disable-next-line +export const netlify_builder: NitroPreset = extendPreset(netlify, { + entry: '{{ _internal.runtimeDir }}/entries/netlify_builder' +}) diff --git a/src/runtime/entries/netlify_builder.ts b/src/runtime/entries/netlify_builder.ts new file mode 100644 index 0000000000..bc46feb92b --- /dev/null +++ b/src/runtime/entries/netlify_builder.ts @@ -0,0 +1,6 @@ +// @ts-ignore +import { builderFunction } from '@netlify/functions' +// @ts-ignore +import { handler as _handler } from '~runtime/entries/lambda' + +export const handler = builderFunction(_handler)