Let function package.individually config override service artifact #5364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What did you implement:
Closes juanjoDiaz/serverless-plugin-warmup#25
The problem that this feature solves is that, if you set a service level artifact, functions marked as
package: individually: true
are not packaged individually as you would expect but use the service artifact instead.This change simply allows you do to do:
So all the functions will use the
my-app.zip
artifact butmyIndividualFunc
will be packaged normallyHow did you implement it:
It's a pretty trivial change. Simply check if the function is set to package individually and, if so, package it individually. :)
How can we verify it:
I've added a test that proves that the feature works and doesn't break existing functionality.
It's pretty trivial to verify with a small app:
running
serverless package
with the above config will create a zip forfunc/handler.func
(the func folder needs to exist of course).At the moment is doesn't and it just tries to use
my-app.zip
insteadTodos:
Is this ready for review?: YES
Is it a breaking change?: NO