dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 41 forks source link

5.1 accidentally omits some dependencies for individually packaged functions #81

Closed oezi closed 1 month ago

oezi commented 1 year ago

Setup:

Result:

Reason: pull-request #80 (merged in https://github.com/dougmoscrop/serverless-plugin-include-dependencies/commit/5219162301a6bec3416c750c2110c54fcd9daf0c and released with version 5.1) introduced the "checkedFiles"-Set. This Set does not get cleared before/after processing the next function. In my example above, when getDependencyList for the second function gets called, the util-Files are already present in this Set und thus get skipped - wich leads to missing the dependencies only used by the utils.

possible (hacky) fixes:

both of the fixes work for my usecase, but probably mess with the intend of #80 - i'm new to this project, so i'm not sure, what a good/correct fix would look like. Maybe @tenbradley as the author of #80 can help here. I could also do some more tests and create a pull-request with one of my solutions, if @dougmoscrop wants me to do so.

baloran commented 1 year ago

Same problem here ! Two fonctions with same import doesn't import same node_modules

KingSheamus commented 1 year ago

Also the same here after an Upgrade to Version 5.1. With version 5.0 it seems to work..thats why I just downgraded back to 5.0

dougmoscrop commented 1 year ago

I've marked 5.1 as deprecated so it won't be installed anymore while we fix things.