From netlify-skills
Reference netlify.toml syntax for build settings, redirects with splats/conditions, headers, deploy contexts, environment variables, functions, and edge functions config on Netlify.
npx claudepluginhub netlify/context-and-tools --plugin netlify-skillsThis skill uses the workspace's default tool permissions.
Place `netlify.toml` at the repository root (or at the base directory for monorepos).
Deploys static/SPA sites and serverless functions to Netlify, validating build config, redirects, headers, environment variables, and deployment readiness.
Guides deploying frameworks (Vite/React, Astro, TanStack Start, Next.js, Nuxt, SvelteKit, Remix) to Netlify using adapters for SSR, Edge Functions, redirects, 404s, and env vars.
Deploys funnel pages to Netlify using CLI. Covers setup, preview/production deploys, netlify.toml redirects/headers, custom domains, env vars, and form handling.
Share bugs, ideas, or general feedback.
Place netlify.toml at the repository root (or at the base directory for monorepos).
[build]
base = "project/" # Base directory (default: root)
command = "npm run build" # Build command
publish = "dist/" # Output directory
# Basic redirect
[[redirects]]
from = "/old"
to = "/new"
status = 301 # 301 (default), 302, 200 (rewrite), 404
# SPA catch-all
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Splat (wildcard)
[[redirects]]
from = "/blog/*"
to = "/news/:splat"
# Path parameters
[[redirects]]
from = "/users/:id"
to = "/api/users/:id"
status = 200
# Force (override existing files)
[[redirects]]
from = "/app/*"
to = "/index.html"
status = 200
force = true
# Proxy to external service
[[redirects]]
from = "/api/*"
to = "https://api.example.com/:splat"
status = 200
[redirects.headers]
X-Custom = "value"
# Country/language conditions
[[redirects]]
from = "/*"
to = "/fr/:splat"
status = 200
conditions = { Country = ["FR"], Language = ["fr"] }
Rule order matters — Netlify processes the first matching rule. Place specific rules before general ones.
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
Headers apply only to files served from Netlify's CDN (not to function or edge function responses — set those in code).
Override settings per deploy context:
[context.production]
command = "npm run build"
environment = { NODE_ENV = "production" }
[context.deploy-preview]
command = "npm run build:preview"
[context.branch-deploy]
command = "npm run build:staging"
[context.dev]
environment = { NODE_ENV = "development" }
# Specific branch
[context."staging"]
command = "npm run build:staging"
[build.environment]
NODE_VERSION = "20"
[context.production.environment]
API_URL = "https://api.prod.com"
[context.deploy-preview.environment]
API_URL = "https://api.staging.com"
Do not put secrets in netlify.toml (it's committed to source control). Use the Netlify UI or CLI for sensitive values. See the netlify-cli-and-deploy skill for CLI environment variable management.
[functions]
directory = "netlify/functions" # Default
node_bundler = "esbuild"
# Scheduled function
[functions."cleanup"]
schedule = "@daily"
[[edge_functions]]
path = "/admin"
function = "auth"
# Import map for Deno URL imports
[functions]
deno_import_map = "./import_map.json"
[dev]
command = "npm start" # Dev server command
port = 8888 # Netlify Dev port
targetPort = 3000 # Your app's dev server port
framework = "#auto" # "#auto", "#static", "#custom"
[[plugins]]
package = "@netlify/plugin-lighthouse"
[plugins.inputs]
audits = ["performance", "accessibility"]
[images]
remote_images = ["https://example\\.com/.*"]
See the netlify-image-cdn skill for full Image CDN usage.