1) if functions in the different module needs a shared py file, how can they import it?
2) do files stated in the serverless.yml
package:
- include
are added to the lambdas?
correct.
Hi guys, have you successfully used it?
I have the same use case, and I can't make it work. The include/exclude directives are totally ignored, whether they are at the package top level, or at function level.
Please note I am using individually packaging.
Hi guys, have you successfully used it?
I have the same use case, and I can't make it work. The include/exclude directives are totally ignored, whether they are at the package top level, or at function level.Please note I am using individually packaging.
I have same issue. I mentioned the folder name in include but it is ignored.
Including files outside the module doesn't work.
It correctly packaged locally, but didn't deploy all the packaged files to the remote lambda.
if you have shared code outside the modules, symlink that into the modules.
It seems like the package includes and excludes won't have an impact on packaging if invoked with individually: true. This is due to the two part process underlying the implementation:
1) the basic serverless packaging creates a zip-File called <functionname>.zip, which basically contains (on a function level) everything according to the defined excludes and includes.
2) _a part of the zip-File_ resulting from step 1 is injected into a final zip (which also contains the requirements)
What do I mean, by _a part_? Only files contained under the directory specified by module are copied to the final zip.
see inject.js:
function moveModuleUp(source, target, module, options) {
...
.then(sourceZip => sourceZip.filter(file => file.startsWith(module + '/')))
...
This is intended behavior right now. However, I am currently also working on the individually feature and think this could be part of the new functionality which I am proposing in #279 .
Most helpful comment
Hi guys, have you successfully used it?
I have the same use case, and I can't make it work. The include/exclude directives are totally ignored, whether they are at the package top level, or at function level.
Please note I am using individually packaging.