From 0a33c1826fce89fa3c1958365e295e462d1d1642 Mon Sep 17 00:00:00 2001 From: Dave Newman Date: Tue, 22 Sep 2015 20:45:15 -0700 Subject: [PATCH] Add option to compile with babel --- lib/commands/deploy_lambda.js | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) 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",