You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for putting this repo together! All the examples are very useful and this is the best collection that I've seen so far.
My understanding of Lerna and Workspaces is that it hoists each project's dependencies into shared node_modules that exist above the project's directory. This allows projects to share dependencies easily. However, when you need to deploy a zip file to lambda, it is actually less convenient for dependencies to be stored in multiple places -- it would be nice if you could simply zip the build directory and the node_modules directory.
I can't see in your code how node_modules is built and included in your deploy packages. Also, is it possible for your sample-google package to depend on your sample-graphql package in such a way that sample-graphql can be included in the deploy bundle for sample-google?
The text was updated successfully, but these errors were encountered:
Sorry, @ajhool , just came across this. Somehow missed it when raised. I imagine you already have your answer by now. In case that is not the case:
This approach uses the serverless webpack plugin, that automatically includes any referenced dependencies in the bundle that is build and deployed. This means that it is self contained, and all modules not referenced are not pulled into the bundle so it remains relatively small. It also means that you are not tying yourself to platform specific approaches such as Lambda layers.
If you wanted to include resources from other bundles, you could either release the bundle as an npm package to be added as a dependency. (lerna can publish each package and auto- wire dependencies.). Or you could move shared utils into its own package and include that or reference the files directly. For example if you had utils to abstract DynamoDB, you could maintain this in a separate package/dir and just import it into consuming packages.
Hope that helps, and again apologies for the lack of response earlier.
First, thanks for putting this repo together! All the examples are very useful and this is the best collection that I've seen so far.
My understanding of Lerna and Workspaces is that it hoists each project's dependencies into shared node_modules that exist above the project's directory. This allows projects to share dependencies easily. However, when you need to deploy a zip file to lambda, it is actually less convenient for dependencies to be stored in multiple places -- it would be nice if you could simply zip the build directory and the node_modules directory.
I can't see in your code how node_modules is built and included in your deploy packages. Also, is it possible for your
sample-google
package to depend on yoursample-graphql
package in such a way thatsample-graphql
can be included in the deploy bundle forsample-google
?The text was updated successfully, but these errors were encountered: