Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A esbuild plugin for arc typescript to copy your schema.prisma file into your lambda build directories
let copyPrismaSchema = {
name: "copy-prisma-schema",
setup(build) {
build.onEnd((result) => {
const fs = require("fs");
const source = `${__dirname}/prisma/schema.prisma`;
const destination = build.initialOptions.outfile.replace(
"index.js",
"schema.prisma"
);
fs.copyFileSync(source, destination);
});
},
};
module.exports = {
plugins: [copyPrismaSchema],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment