-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Packaging configuration seems to be ignored #352
Comments
So, the tricky part is for service packaging in SLS (with or without jetpack) diff --git a/serverless.yml b/serverless.yml
index bd741b3..b14d5dd 100644
--- a/serverless.yml
+++ b/serverless.yml
@@ -4,9 +4,6 @@ provider:
name: aws
runtime: nodejs14.x
-plugins:
- - serverless-jetpack
-
functions:
myFunction:
name: 'myFunction'
@@ -16,7 +13,7 @@ functions:
preInclude:
- 'files/function-pre-include.txt'
- '!files/function-pre-exclude.txt'
-
+
package:
include:
- 'files/function-include.txt'
@@ -31,5 +28,6 @@ custom:
package:
include:
+ - '!**'
- 'files/package-include.txt'
- '!files/package-exclude.txt' Where I've disabled jetpack, added a service level We end up with only one file in this case: $ yarn sls package && zipinfo -1 .serverless/jetpack-test.zip
files/package-include.txt |
Turning now to Jetpack, jetpack does the same thing -- diff --git a/serverless.yml b/serverless.yml
index bd741b3..84a02a2 100644
--- a/serverless.yml
+++ b/serverless.yml
@@ -16,8 +16,9 @@ functions:
preInclude:
- 'files/function-pre-include.txt'
- '!files/function-pre-exclude.txt'
-
+
package:
+ individually: true
include:
- 'files/function-include.txt'
- '!files/function-exclude.txt'
@@ -25,11 +26,11 @@ functions:
custom:
jetpack:
preInclude:
- - '!**/**'
+ - '!**'
- 'files/service-pre-include.txt'
- '!files/service-pre-exclude.txt' The resulting report (and zip file if you info it) now show all four of your expected include files: $ yarn sls jetpack package --report
# ...
### Files (`8`): Included
- files/function-include.txt
- files/function-pre-include.txt
- files/package-include.txt
- files/service-pre-include.txt
- node_modules/is-number/LICENSE
- node_modules/is-number/README.md
- node_modules/is-number/index.js
- node_modules/is-number/package.json I would characterize this issue as: (1) expected behavior, that (2) is not well-documented either in SLS or in this plugin. Accordingly I've opened #353 to better document this. Hopefully this helps you through your issue. I wanted to further thank you for taking the time to open up a full error reproduction repository -- it makes diagnosis and discussion of nuanced issues like these actually tractable! |
Thanks! |
Hi!
I'm facing some trouble when generating the package, and I think files are not being included correctly.
Setup
I'm using [email protected], and [email protected]
I have this serverless.yml:
And my file structure is pretty straight-forward:
Excpected:
The expected should be a zip file with all
*include.txt
files, along with node_modules production dependencies, like so:Actual Result:
When running
yarn serverless package
, the zip file contains only this files:Report
When generating report, this is what I'm getting:
I also conducted another test, but this time removing the
- !**/**
line from custom.jetpack.preInclude; This time, I got in the output package all files infiles
folder, except forservice-pre-exclude
andpackage-exclude
.This way, both of this tests show that
function.{NAME}.package.include
andfunction.{NAME}.jetpack.preInclude
are being ignored; So, the question is: What am I missing? Is this a configuration issue? Or did I misunderstand the documentation?Here, I'm leaving a repo where you can clone and test this very same repository that I used and reproduce this issue:
https://github.com/DanEscudero/sls-jetpack-issue-reproduction
Thanks in advance!
The text was updated successfully, but these errors were encountered: