agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 53 forks source link

copyProjectFile should NOT call init() every time #165

Open ShlomoVinny opened 4 months ago

ShlomoVinny commented 4 months ago

https://github.com/agutoli/serverless-layers/blob/842eb7ce374af7a400e6cec2176bcc6f1882919c/src/package/Dependencies.js#L87

Init() has been called in install() already and should only be called ONCE per run, or else it just deletes all the previously copied files, like the package.json file, which lead me to believe there was an error with copying, but there is not. The issue is due to these recurrent init() calls.

Solution: Remove this.init(); from line 87 in Dependencies.js