Gitignore Plugin
Adds every generated file to your .gitignore automatically, so you don't have to track Baeta's output. (If you'd rather track generated files to review them in PRs, skip this plugin.)
Installation
- yarn
- npm
- pnpm
- bun
yarn add @baeta/plugin-gitignore -D
npm install @baeta/plugin-gitignore -D
pnpm add @baeta/plugin-gitignore -D
bun add @baeta/plugin-gitignore -D
Configuration
Enable the gitignore plugin in your baeta.ts:
import { defineConfig } from "@baeta/cli";
import { gitignorePlugin } from "@baeta/plugin-gitignore";
export default defineConfig({
// ... other config
plugins: [gitignorePlugin()],
});
For the full configuration interface, see the GitignoreOptions API reference.
warning
Register this plugin first. It only sees files generated by plugins that ran before it — anything after gets missed.
How it works
On every run, the plugin:
- Collects the file lists declared by other Baeta plugins.
- Writes the matching entries into
.gitignore. - Updates
.gitignorewhen the set of generated files changes.