2.2.0 • Published 8 years ago
serverless-plugin-lambda-reducer v2.2.0
serverless-plugin-lambda-reducer
Reduce lambda package so it hosts only lambda dependencies
Plugin for Serverless v1
(for Serverless v0.5 version see serverless-0.5 branch)
By default Serverless packages whole contents of service folder in which lambda was configured, it raises issues in projects where we maintain many functions under one service, as package for each lambda contains content of whole service.
This plugin ensures that it is only dependencies of given lambda that are packaged and deployed to remote instance
Installation
$ npm install serverless-plugin-lambda-reducerConfiguration (within serverless.yml)
- Ensure individual functions packaging by setting
individually: trueforpackagegroup. (See Packaging functions separately for more info)
package:
individually: true- Activate plugin in
serverless.yml
plugins:
- serverless-plugin-lambda-reducer- If there some files that need to be included but escape automatic dependencies resolution (e.g. non Node.js module files, or modules required through dynamically resolved paths) they need to be included through
includeoption as e.g.
functions:
hello:
handler: handler.hello
package:
include:
- non-node-js-module.txt
- required-through-dynamic-path.jsSee Packaging functions separately for more info.