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

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 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 .gitignore when the set of generated files changes.