Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Allow layer creation of user built modules #60

Open
AmanL04 opened this issue Nov 27, 2020 · 1 comment
Open

Allow layer creation of user built modules #60

AmanL04 opened this issue Nov 27, 2020 · 1 comment

Comments

@AmanL04
Copy link

AmanL04 commented Nov 27, 2020

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)

@m0uneer
Copy link

m0uneer commented Jul 18, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants