New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

serverless-webpack-prisma

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-webpack-prisma

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

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
1.2K
8.25%
Maintainers
1
Weekly downloads
 
Created
Source

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

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

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

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
    dataProxy: false # Passing this param, plugin will create the prisma client for use with a data proxy see: https://www.prisma.io/docs/data-platform/data-proxy
    useSymLinkForPrisma: true # Passing this param, plugin will symlink prisma dir instead of copying.
    ignoreFunctions: # Passing this param, we tell plugin which functions should be ignored and processed as non prisma based functions.
      - someNonPrismaFunction
    version: "5.0.0" # Passing this param, we teel plugin which version of prisma to install: Default: "" 
  webpack:
    webpackOutputPath: ./ # Passing this param, plugin will change the directory to find the dir .webpack

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

Keywords

serverless

FAQs

Package last updated on 24 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts