Ensure consistent patterns for configuration files, proper exclusion of development artifacts, and clear environment-specific handling across projects.
Key practices:
.wrangler
.dev.vars*
Maintain configuration format consistency - When migrating between formats (e.g., wrangler.toml to wrangler.json), ensure all templates and documentation are updated consistently to avoid breaking changes.
CLOUDFLARE_ENV
to select configurations at build/dev time:
```toml
name = “my-worker” vars = { MY_VAR = “Top-level var” }
[env.production] vars = { MY_VAR = “Production var” } ```
This prevents configuration drift, avoids committing sensitive development files, and ensures consistent behavior across different environments and project types.
Enter the URL of a public GitHub repository