Skip to main content
Version: Next (2.x)

Plugins

Plugins extend Baeta at build time: they generate code, run external commands, transform files, and shape the output of yarn build. They are different from app plugins (authAppPlugin, complexityAppPlugin), which extend Baeta at runtime.

Configuration​

Register plugins in baeta.ts:

import { defineConfig } from "@baeta/cli";
import { gitignorePlugin } from "@baeta/plugin-gitignore";
import { prismaPlugin } from "@baeta/plugin-prisma";
import { createExecPlugin } from "@baeta/plugin-exec";

export default defineConfig({
graphql: {
schemas: ["src/**/*.gql"],
},
plugins: [
gitignorePlugin({
// plugin options
}),
prismaPlugin({
// plugin options
}),
createExecPlugin({
// plugin options
}),
// Add more plugins here
],
});
tip

Order matters for some plugins. Gitignore should run first; the others are mostly order-independent. Each plugin's page calls out anything special.