Home
Support Forums

Custom Functions Directory Per Site (with same repo)

Hi Guys, this may seem like a confusing question, so feel free to ask me to clarify.

Basically all of our sites are pointed to the same repo, such that when I do a prod push all sites get updated. I have this configured.

Using this configuration, is there any way to Dynamically deploy a functions directory from a location thats NOT in the repo? Basically our users (who will each have their own site) will be able to add plugins. These node.js files will be stored in our Storage Bucket, but I was wondering if Netlify is able to use such a directory to deploy a dynamic file to a site’s serverless backend (say, through an API call).

Hey @Artathecanadian,

Netlify needs the repo to have all the files that you need or generate them during the build time. So, depending on your setup, you might want to write a script that would fetch all the functions and store them in the functions’ directory which Netlify will then use for bundling.

Would I be able to dynamically update the site functions through API? Or would I have to trigger a new deploy

Functions, just like most other changes in a site need a new deploy.