diff --git a/lib/commands/deploy_lambda.js b/lib/commands/deploy_lambda.js index dcfc081dd..fbab287af 100644 --- a/lib/commands/deploy_lambda.js +++ b/lib/commands/deploy_lambda.js @@ -14,6 +14,7 @@ var JawsError = require('../jaws-error'), AWS = require('aws-sdk'), AWSUtils = require('../utils/aws'), utils = require('../utils/index'), + babelify = require('babelify'), browserify = require('browserify'), UglifyJS = require('uglify-js'), wrench = require('wrench'), @@ -622,6 +623,10 @@ Packager.prototype._browserifyBundle = Promise.method(function() { }, }); + if (_this._awsmJson.lambda.package.optimize.babel) { + b.transform(babelify) + } + // optimize.exclude _this._awsmJson.lambda.package.optimize.exclude.forEach(function(file) { b.exclude(file); diff --git a/package.json b/package.json index 2ecd5892b..32aa1b7bc 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "dependencies": { "async": "^0.9.0", "aws-sdk": "^2.1.24", + "babelify": "^6.3.0", "bluebird": "^2.9.34", "browserify": "^11.0.1", "chalk": "^1.1.0",