I have code that exists in my index.js with numerous functions that have different really expensive imports. From my understanding, these functions share all global imports. So, I have two options
- do all imports globally which leads to slow cold starts but faster function calls when warm idle instances are available
- do lazy imports inside the functions, which makes for fast cold starts but slower function calls
I was wondering if a third option exists where I can split the index.js such that global imports are separated. Is there such an option, or an alternative that I am missing?