4.0.1 • Published 2 years ago

serverless-plugin-reducer v4.0.1

Weekly downloads
1,690
License
ISC
Repository
github
Last release
2 years ago

Build status Tests coverage npm version

serverless-plugin-reducer

Reduce Node.js lambda package so it contains only lambda dependencies

Plugin for the Serverless Framework v2+

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.

This plugin ensures that it is only dependencies of given lambda that are packaged and deployed to remote instance

Installation

$ npm install serverless-plugin-reducer

Configuration (within serverless.yml)

  1. Ensure individual functions packaging by setting individually: true for package group. (See Packaging functions separately)
package:
  individually: true
  1. Activate plugin in serverless.yml
plugins:
  - serverless-plugin-reducer
  1. If there ar 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 include option as e.g.
functions:
  hello:
    handler: handler.hello
    package:
      include:
        - non-node-js-module.txt
        - required-through-dynamic-path.js
  1. If for some paths module files cannot be found, by default an informative error is thrown. Still if the cases are safe to ignore, you may silence those errors with:
custom:
  reducer:
    ignoreMissing: true

Tests

npm test
4.0.1

2 years ago

4.0.0

2 years ago

3.2.4

4 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

6 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.1

7 years ago

1.2.1

7 years ago