Skip to content

Commit

Permalink
fix(netlify-edge): update output format
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 16, 2023
1 parent 392ce64 commit 41a4a6a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/presets/netlify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { existsSync, promises as fsp } from "node:fs";
import { join, dirname } from "pathe";
import { defineNitroPreset } from "../preset";
import type { Nitro } from "../types";
import { name, version } from "../../package.json";

// Netlify functions
export const netlify = defineNitroPreset({
Expand Down Expand Up @@ -53,24 +54,27 @@ export const netlifyEdge = defineNitroPreset({
extends: "base-worker",
entry: "#internal/nitro/entries/netlify-edge",
output: {
serverDir: "{{ rootDir }}/.netlify/edge-functions",
serverDir: "{{ rootDir }}/.netlify/edge-functions/server",
publicDir: "{{ rootDir }}/dist",
},
rollupConfig: {
output: {
entryFileNames: "server.mjs",
entryFileNames: "server.js",
format: "esm",
},
},
hooks: {
"rollup:before": (nitro: Nitro) => deprecateSWR(nitro),
async compiled(nitro: Nitro) {
// https://docs.netlify.com/edge-functions/create-integration/
const manifest = {
version: 1,
functions: [
{
path: "/*",
name: "nitro server handler",
function: "server",
pattern: "^.*$",
generator: `${name}@${version}`,
},
],
};
Expand Down

0 comments on commit 41a4a6a

Please sign in to comment.