Babel preset for AWS λ functions
This preset currently transforms code to be compatible with node versions of amazon AWS lambda funcions.
- Defaults transpiling code to node version
6.10
. regenerator-runtime
is too heavyweight so it is excluded.- Object rest/spread transform.
- Async/await.
- Exponentiation Operator.
$ npm install --save-dev babel-preset-aws-lambda
.babelrc
{
"presets": ["aws-lambda"]
}
$ babel script.js --presets aws-lambda
require("babel-core").transform("code", {
presets: ["aws-lambda"]
});
This module uses babel-preset-env
to target specific environments.
Please refer to babel-preset-env#targets for a list of available options.
You may override our default list of targets by providing your own targets
key.
{
"presets": [["aws-lambda", {
"targets": {
"node": 4
}
}]]
}
To enable debug mode, set the debug
key to true
.
{
"presets": [["aws-lambda", {
"debug": true
}]]
}