When I run sls function deploy myFunction1 it always fails with an error: myFunction1: ENOENT: no such file or directory, lstat 'C:\Workspaces\AWS\LambdaFunctions\MyProject\_meta\_tmp\myFunction1@1464958827455\lib'. So, when I create an empty lib folder in the functions folder, it succeeds. However, the contents of MyProject/functions/lib are not included in the resulting zip file. I'm expecting there to be a folder called lib with the contents of the lib folder in the project, namely common.js. Now, if I put the common.js file in that new empty lib folder, then it does end up in the zip. But, if I delete the lib folder in the project root, because it appears to not actually get utilized, then I get an error: myFunction1: ENOENT: no such file or directory, lstat 'C:\Workspaces\AWS\LambdaFunctions\MyProject\lib'. So it appears that the optimizer is checking for the folder to actually exist in both places, but only taking the content from the one in the functions folder. This is not what I would expect or desire, I want the includePaths to be relative to the project root and actually take the files/folders defined there and not need to maintain a shadow copy somewhere in subfolders.
I'm running serverless version 0.5.5 on Windows 10 1511 with node.js version 5.6.0 and serverless-optimizer version 2.5.1.
First, given a folder structure like:
and my optimize section looks like:
and my handler is defined as
When I run
sls function deploy myFunction1
it always fails with an error:myFunction1: ENOENT: no such file or directory, lstat 'C:\Workspaces\AWS\LambdaFunctions\MyProject\_meta\_tmp\myFunction1@1464958827455\lib'
. So, when I create an empty lib folder in the functions folder, it succeeds. However, the contents of MyProject/functions/lib are not included in the resulting zip file. I'm expecting there to be a folder called lib with the contents of the lib folder in the project, namely common.js. Now, if I put the common.js file in that new empty lib folder, then it does end up in the zip. But, if I delete the lib folder in the project root, because it appears to not actually get utilized, then I get an error:myFunction1: ENOENT: no such file or directory, lstat 'C:\Workspaces\AWS\LambdaFunctions\MyProject\lib'
. So it appears that the optimizer is checking for the folder to actually exist in both places, but only taking the content from the one in the functions folder. This is not what I would expect or desire, I want the includePaths to be relative to the project root and actually take the files/folders defined there and not need to maintain a shadow copy somewhere in subfolders.