We are working on a project/framework that aids in deploying and maintaining code in AWS Lambda. I want to build/bundle all node.js code for a lambda function into one js file b
Possible answer might be making the function behave like a bootloader. Make the function download packaged code from S3, unpack it and run it.
Having to touch the code the way you're proposing seems like a bad idea that could result in unpredictable and hard to debug bugs.