Module bundlers
Overview
Module bundlers bundle JavaScript modules into a single JavaScript file. Most bundlers work by copying over the JavaScript code from a variety of source files into the target file.
Since Prisma Client is not only based on JavaScript code, but also relies on the query engine binary file to be available, you need to make sure that your bundled code has access to the binary file.
To do so, you can use plugins that let you copy over static assets:
Bundler | Plugin |
---|---|
Webpack | copy-webpack-plugin |
Webpack (with Next.js monorepo) | nextjs-monorepo-workaround-plugin |
Parcel | parcel-plugin-static-files-copy |