Gitignore Plugin
The Gitignore plugin automatically adds generated files to your .gitignore
, keeping your repository clean from auto-generated code. While some developers prefer to track generated files to review changes, this plugin provides a simple way to ignore them.
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()],
});
warning
For the plugin to work correctly, it should be registered before plugins that generate any kind of files.
For most use cases, it should be the first plugin in the list, before even the autoload plugin
.
How It Works
The plugin automatically:
- Detects all generated files from other Baeta plugins
- Adds appropriate entries to your
.gitignore
file - Updates the
.gitignore
file when the configuration changes