serverless-layers
serverless-layers copied to clipboard
Allow layer creation of user built modules
I am new to serverless and from the jump, I noticed that layers using the plugin "serverless-layers" cannot include user-defined modules (common code).
Please add support to allow layer creation from folders (which can also include requirements.txt)
Inspecting the source code, I found this undocumented option copyBeforeInstall
serverless-layers:
customInstallationCommand: npm run myCustomCommand # If you use NodeJS, but you can set the command that suits your case
copyBeforeInstall:
- package-lock.json # Again, if you use NodeJS so please check the repo for default files needed for every package manager
- path/to/custom/files # This file will be part of the layers
In addition, the customInstallationCommand
option can give the flexibility needed to do anything with copyBeforeInstall
files set.