@@ -43,7 +43,7 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U
4343 } else {
4444 functions . push ( {
4545 function : entryFile ,
46- pattern : route . pattern . source ,
46+ pattern : route . pattern . toString ( ) ,
4747 } ) ;
4848 }
4949 }
@@ -53,7 +53,10 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U
5353 version : 1 ,
5454 } ;
5555
56- const manifestURL = new URL ( './manifest.json' , dir ) ;
56+ const baseDir = new URL ( './.netlify/edge-functions/' , dir )
57+ await fs . promises . mkdir ( baseDir , { recursive : true } ) ;
58+
59+ const manifestURL = new URL ( './manifest.json' , baseDir ) ;
5760 const _manifest = JSON . stringify ( manifest , null , ' ' ) ;
5861 await fs . promises . writeFile ( manifestURL , _manifest , 'utf-8' ) ;
5962}
@@ -79,6 +82,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
7982 entryFile = buildConfig . serverEntry . replace ( / \. m ? j s / , '' ) ;
8083 buildConfig . client = _config . outDir ;
8184 buildConfig . server = new URL ( './edge-functions/' , _config . outDir ) ;
85+ buildConfig . serverEntry = 'entry.js' ;
8286 } ,
8387 'astro:build:setup' : ( { vite, target } ) => {
8488 if ( target === 'server' ) {
@@ -88,7 +92,7 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
8892 }
8993 } ,
9094 'astro:build:done' : async ( { routes, dir } ) => {
91- await createEdgeManifest ( routes , entryFile , new URL ( './edge-functions/' , dir ) ) ;
95+ await createEdgeManifest ( routes , entryFile , _config . root ) ;
9296 } ,
9397 } ,
9498 } ;
0 commit comments