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 because:
- Smaller codebases help with lambda cold start issues
- Lambda has code zip size limit of 50MB
We don't want to create a custom bundler to do this because there are many options already out there (systemjs,browserify,webpack etc). HOWEVER we are concerned with issues with some node modules not playing well with bundlers/builders.
Specifically aws-sdk
has known issues with webpack, says it has browserify support but I've talked to people who have had issues with browserify'ing aws-sdk
We want to pick an existing bundler (or 2), but we want to make sure it works for as many modules/code as possible. We are trying to create a plugin ecosystem for JAWS, so getting this right is important (don't want to turn people off because module X they use wont bundle).
Questions:
- How would I go about bundling/building to satisfy these constraints?
- Is there any guidelines we can give to consumers of our product to ensure the code they write/use will bundle? Ex: Dynamic require()s cause issues AFAIK.