serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack
MIT License
1.72k stars 414 forks source link

"individually" flag in function definition is ignored #463

Open deftomat opened 5 years ago

deftomat commented 5 years ago

This is a Bug Report

Description

Using individually: true in function definition is ignored.

According to serverless docs, you can add individually flag on per-function basis.

functions:
  myFunction:
    handler: myFunction.handler
    package:
      individually: true

Unfortunately, this flag is ignored by this plugin. I will happily create a PR but your guidance could really help.

Additional Data

hassankhan commented 5 years ago

@HyperBrain is this currently possible at all? I was under the impression you could either have all your functions packaged into one ZIP, or each function separately packaged, but not a mixture of both?

HyperBrain commented 5 years ago

@hassankhan @deftomat Yes, that's right. The plugin checks the global package setting and either packages all functions separately or as one service zip. In general, there should not be any need to create a mixed output.

hassankhan commented 5 years ago

Thanks for confirming that, @HyperBrain 👍.

@deftomat is there a use-case you had in mind?

roni-frantchi commented 4 years ago

@hassankhan

I have a use-case.
There's a log forwarding lambda, which I'd like to have deployed alongside each of my services.
I'd like that to be included in each of the services so I may pass custom metadata to that log forwarding lambda configuration in each service.

This lambda isn't my package, but a dependency and is written in Python.
As such, I'd like this lambda alone to be packaged separately.

  logzio:
    package:
      individually: true
    runtime: python3.6
    handler: functions/logzio.lambda_handler
    logForwarding:
      enabled: false
filipsuk commented 4 years ago

Missing this feature as well. My AWS cognito trigger functions are small and need to be quick. Rest of functions share same large dependencies and should be in one package.