Add a .slsignore to you serverless project
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js
package-lock.json
package.json

README.md

serverless-ignore

serverless npm npm

Serverless plugin to ignore files like a .gitignore

Why

  • Remove long list of hardcoded exclude files from serverless.yml
  • Better managing between different serverless.yml (just add a different .slsignore)
  • Same approach of .gitignore

Install

npm install --save-dev serverless-ignore

Usage

Add serverless-ignore to your plugins list (serverless.yml)

plugins:
  - serverless-ignore

Add a .slsignore in your root folder with a .gitignore-like syntax with all the files you want to ignore

Example:

# it works like a .gitignore
# for sls
README.md
*.log

# ignore aws-sdk
node_modules/aws-sdk/*

.env.example
.git/*
__tests__/*