Has anyone had any success on deploying prisma wit...
# orm-help
j
Has anyone had any success on deploying prisma with serverless webpack to aws lambda? With webpack the issue seems to be that the package zip file becomes too large since unneeded prisma nodemodules are not excluded edit: I got it working with following solution, might not be the best but it works. I went through the zip file that serverless deploy generates and located the engine files that are requiring lots of space but that are not required. Then I inserted “rm” script on each of those after the prisma generate command, like so:
custom:
webpack:
includeModules: true
packagerOptions:
scripts:
- prisma generate
- rm -R node_modules/@prisma/engines
- rm -R node_modules/@prisma/engines-version
- rm node_modules/prisma/libquery_engine-darwin.dylib.node
- rm -R node_modules/prisma/engines
1
r
Yes excluding them like this is the way as of now.
j
Yes it seems to do the trick! I would have an other question related to this also. Node modules still include other files which seem quite large and I am not sure what of those are actually needed after the build when running with serverless lambda. Here is (@)prisma and prisma folders inside the serverless package. The “libquery_engine-rhel-openssl-1.0.x.so.node” I assume is the important one, but what about the rest? I am trying to reduce the package size to a minimum
r
This is minimum you would get at the moment. Zipped size should be around 11-12 MB
j
If I zip prisma folder it is showing me a size of 33MB, before removing anything, I dont know if I have missed something. After removing the files with rm -command I get to 20MB zipped size in my serverless package