In the docs, there is the possibility to use regex for edge function declarations in the context of framework integrations ( in the json manifest using "pattern: " instead of "path: ")
I was wondering if that is somehow also possible outside of frameworks integrations.
Or if there was an option to use a edge-bundler for hugo (I have seen an edge function bundler plugin for Vite but I’m not sure if there’s one that could make work for hugo)
docs: Create an Edge Functions integration | Netlify Docs
Thx!
I don’t think Hugo needs a custom integration. Any manifest.json
that you put inside .netlify/edge-functions
will be used. So you can dynamically create that file during the build process and Netlify will read that. You can include RegEx in that file.
Actually I do have a RegEx -based manifest.json in .netlify/edge-functions
that works perfectly fine in development.
But it doesn’t work in production. Likely because the .netlify folder gets automatically ignored on build.
Not quite. The problem is, Netlify CLI adds .netlify
folder automatically to your .gitignore
(and for good reasons). This is why you should generate a manifest during build (or copy it from some other folder).
thank you for the hint!
I’ve put the manifets.json in an /edge folder in /static, since in hugo the static folder resolves to the public(publish) folder. And than run the bash command:
command = "hugo && cp -f public/edge/manifest.json .netlify/edge-functions"
But… I’m not an expert so it’s still notworking ^^