danieluhm2004 / serverless-webpack-prisma

When using serverless webpack, you can save up to 50% of package capacity by deleting unnecessary Prisma engine.
https://www.npmjs.com/package/serverless-webpack-prisma
MIT License
33 stars 27 forks source link

Engines not deleted #11

Closed rgarcia-longevo closed 1 year ago

rgarcia-longevo commented 2 years ago

Hi, Team!

I'm working with the dependency prisma (^3.13.0) and I found an instance engine that isn't deleted. The path is _node_modules/prisma/engines/73e60b76d394f8d37d8ebd1f8918c79029f0db86/libqueryengine-darwin.dylib.node.

I've read the code and I found that the solution is update the list of engines in the class ServerlessWebpackPrisma adding these two new entries:

I'm fighting with an edge case of limit size related to lambdas and the serverless framework and the only place to reduce my final zip file is your great library.

Thank you!

danieluhm2004 commented 2 years ago

Hello.

With the release of a new version of Prisma, it seems that there are additional binaries.

I've been very busy lately, so I'll try to solve it with other issues once things are resolved to some extent.

I'm sorry for not performing the role of the maintainer properly. Thank you.

danieluhm2004 commented 2 years ago

Hello! I'm sorry about the late reply.

I was checking #12 pull request. I'm using the 4.0.0 version in Prisma.

But, I can't find "node_modules/prisma" in a packaged serverless zip file.

I guess Prisma doesn't use the "node_modules/prisma" directory in 4.0.0.

Please, can you check this problem in the latest version?

Have a nice day. Thank you!

colleen-love commented 2 years ago

I have also noticed that it includes unnecessary binaries when built on windows (for some reason those binaries have a different naming convention, query_engine-*).

danieluhm2004 commented 2 years ago

Okay.

I will check on my windows computer. But, It can take a little bit of time because usually, I use macOS well.

Thank you.

colleen-love commented 2 years ago

Thank you! No rush, fortunately wsl exists. There are no issues when building in wsl.

On Sat, Jul 16, 2022, 01:22 Daniel Uhm @.***> wrote:

Okay.

I will check on my windows computer. But, It can take a little bit of time because usually, I use macOS well.

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/danieluhm2004/serverless-webpack-prisma/issues/11#issuecomment-1186117780, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRCZYIGBLDBFMVNRYDZX2TVUJWLXANCNFSM5VJKSIXQ . You are receiving this because you commented.Message ID: @.***>

fospitia commented 2 years ago

I have the same problem, the only solution that i found was:

webpack:
  includeModules: true
  excludeRegex: node_modules\/@prisma\/engines\/.*|node_modules\/\.bin\/.*