Serverless Package External

homepage icon https://github.com/epsagon/serverless-package-external
Follow @epsagon

Tracked

NPM Downloads Last Month
248
Issues
0
Stars
9
Forks
0
Watchers
9
Watch Star Fork Issue Download License NPM Build Status Coverage Status Contributors

Repo README Contents:

serverless-package-external 📦

serverless License: MIT npm version

Deploy a Serverless Python Function services with external code

Before deploying, this plugin symlinks folders containing shared code into the root directory of your Serverless function.

Installation

npm i serverless-package-external --save-dev

Usage

service: service-name

plugins:
  - serverless-package-external

functions:
  # Your functions here

custom:
  packageExternal:
    external:
      - '../common'
      - '../service-a/module'

Example Directory Structure

└── common
    └── resource.py
└── service-a
    └── handler.py
    └── serverless.yml
    └── module
        └── main.py
└── service-b
    └── handler.py
    └── serverless.yml

In handler.py, external code can be imported:

from common.resource import shared_resource

Licensing

serverless-package-external is licensed under the MIT License.

It is originally based on serverless-package-common.