Webpack plugin to zip up multiple lambda handlers. So far it handles only very simple case to fit my project's requirements.
The lambda folder structure is as below:
project root
package.json
---- lambda1
-------- index.js
---- lambda2
-------- index.js
---- lib
-------- utils.js
See the example config below.
npm install --save-dev lambda-webpack-plugin
webpack.config.js
var LambdaWebpackPlugin = require('lambda-webpack-plugin');
module.exports = {
// ...
webpackConfig.entry = {
'dist/labmda1/handler': './lambda1/index.js',
'dist/labmda2/handler': './lambda2/index.js'
};
plugins: [
new LambdaWebpackPlugin()
]
};
The following zip files are created, and they're ready to deploy to aws platform.
dist/lambda1.zip
dist/lambda2.zip