A Serverless plugin to copy a .env file into the serverless package
npm i serverless-plugin-package-dotenv-file
service: your-service
...
custom:
packageEnv:
fileName: .env-${env:ENVIRONMENT}
plugins:
- serverless-plugin-package-dotenv-file