Reusable functions in cloud code?

I’d like to setup some reusable cloud code helper functions, stuff that’s used in mulitple different cloud code functions without having to replicate the code over and over.

What’s the standard correct way to do this?

I tried setting up a “helper_functions” directory and importing a functions.js into main.js but it broke the build.

what is the broke your build ? can you give me an example ? and yeah you can put it helper.js for helper function or common.js about common things.

It builds ok and it’s importing the functions.ts file and getting the functions fine.

Problem is I get a 502 and a CORS error on the client side after the build.