Open bruno-xo7 opened 6 months ago
just watching, have similar issue
@bruno-xo7 I apologize, maybe it's wrong, but according to the documentation on the service level individually should be true:
...
package:
individually: true
...
and remove individually from function level:
...
three:
handler: src/main.handler3
package:
patterns:
- "!src/not_included_in_3"
...
@bruno-xo7 But in my case I have the same warning as you, but I configure package on service level, and don't use individual at all
...
package:
excludeDevDependencies: true
patterns:
- '!node_modules/serverless*/**'
- '!node_modules/aws_sdk/'
- '!package-lock.json'
...
VSCode plugin says (regarding the same documentation article mentioned in the comment above) that the package block should be on provider level ((
Hello @a-khalilov,
What you describe, it's to have 3 individual packages (in my example), one for each function. My problem is not this case, I want to have one 'global' (a.k.a. not individual) package for functions 'one' and 'two' and one individual package for the function 'three'. This is why I set the 'individually' at false
at service level and true
at the function 3 level.
@bruno-xo7 I see. You're right, I didn't understand your case correctly. But I can confirm, that with my config I tried to reproduce your case and got 2 packages and the error. I'm guessing that the error makes your pipeline fail. Because I've seen both packages and they're correct
Correct @a-khalilov, It's failed at the package step and indeed the deploy is not launched because of the fail
@bruno-xo7 I got your problem. Had something similar with other serverless plugins. I use some pipes as a workaround, something like
sls package | tee /dev/tty | grep -q 'anything of command's output that you would like to use as a condition' && exit 1
I'm sure you found a workaround, but anyway maybe it'll be useful for others
Cheers!
Hello,
I got an issue with the package 'individually' not working. I have setup a simple project to easily test it:
serverless.yml
:plugins:
provider: name: aws runtime: nodejs18.x package: individually: false patterns:
functions: one: handler: src/main.handler1 two: handler: src/main.handler2 three: handler: src/main.handler3 package: individually: true patterns:
package.json
src/main.ts
export const handler1: Handler = async () => { console.info("Hello function one!"); };
export const handler2: Handler = async () => { console.info("Hello function two!"); };
export const handler3: Handler = async () => { console.info("Hello function three!"); };
If I disable the plugin
serverless-plugin-typescript
it's working fine. And I got 2 package in.serverless
directory without error:sls-ts-package-individually.zip
three.zip
Can this be fixed?
Thank you, Bruno