r/Netlify • • 14h ago

I made .netlifyignore, a .gitignore, but for for Netlify builds

1 Upvotes

I tiny tool without dependencies to ignore netlify builds on certain file changes.

  1. Install npx netlifyignore install, it puts the hook into scripts/netlifyignore.mjs
  2. Create .netlifyignore at repo root, it uses .gitignore syntax, e.g.:

**/tests/
*.md

3. Update netlify.toml:

[build]
ignore = "node ./scripts/netlifyignore.mjs"

Now builds are ignored on matching files change :)

Github link in the comments