I’ve got a build generation script (CLI) which builds code into JS in the format of an Edge Function - on the Create an Edge Functions integration | Netlify Docs docs, it mentions you can output a function into netlify/edge-functions. This part is working.
I’ve added a custom build command:
command = "custom_cli build --dev"
It seems Netlify starts, runs my command and then stops as the command stopped with an exit code. I’d like my command to create the edge function, and then let the usual netlify dev server take over as normal.
Is there anyway to run my build script before netlify dev starts?
EDIT: What I’m trying to say is:
Can I write to .netlify/edge-functions before netlify dev kicks off, rather than after, so I don’t have to start my own server?
Right now, it looks for the generated functions (which doesn’t exist), then compiles.
I’ve also noticed that the netlify dev command doesn’t detect file changes when another process has written to a file… but that’s probably one for GitHub issues.
Ah okay, I don’t believe that would be currently possible. Netlify CLI scans and tries to load the functions almost at the start of its process, so I don’t believe there would be any other way to achieve what you need. You can file an issue on the CLI repo as a feature request.