serverless-webpack-prisma-engines

1.1.1 • Public • Published

Serverless Webpack Prisma

When using serverless webpack, you can save up to 50% of package capacity by deleting unnecessary Prisma engines.

How to use?

First, install the package by entering the following command.

npm install -D serverless-webpack-prisma-engines

Add the corresponding plugin under the webpack plugin as shown below.

plugins:
  - serverless-webpack
  - serverless-webpack-prisma-engines

If you have already used the generate script below, please delete it.

custom:
  webpack:
    packagerOptions:
      scripts:
        - prisma generate

This plugin also has some additional configs:

custom:
  prisma:
    installDeps: false # Passing false will not install Prisma dependency during the build process. Default: true
    prismaPath: ../../ # Passing this param, plugin will change the directory to find the dir prisma containing the prisma/prisma.schema

Congratulations. The setup is complete. In the future, packaging will automatically delete unnecessary resources.

Serverless: Generate prisma client for app...
Serverless: Remove unused prisma engine:
Serverless: - node_modules/.prisma/client/libquery_engine-darwin.dylib.node
Serverless: - node_modules/@prisma/engines/introspection-engine-darwin
Serverless: - node_modules/@prisma/engines/libquery_engine-darwin.dylib.node
Serverless: - node_modules/@prisma/engines/migration-engine-darwin
Serverless: - node_modules/@prisma/engines/prisma-fmt-darwin

Package Sidebar

Install

npm i serverless-webpack-prisma-engines

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

16.4 kB

Total Files

8

Last publish

Collaborators

  • fmontagnani