Exporting multiple functions in middleware plugins

I am looking into using cloudflare plugins to apply middleware. We have multiple functions we would like to chain together.
  • One option is to create 4 separate repos. One for each plugin, and then chain them together in the application. However this is not a desirable option for us.
  • the second is to export a single plugin which uses flags to apply the different functions as needed.
  • We are wondering if we can export multiple functions from a single plugin and import whichever ones are needed, to be chained together in the function. This is the preferred option. Can anybody confirm that this is a viable option, and give advice on how best to do this?
    Thanks in advance
Was this page helpful?