Wrangler can automatically detect your framework and configure your project for Cloudflare Workers. This allows you to deploy existing projects with a single command, without manually setting up configuration files or installing adapters.
When you run wrangler deploy or wrangler setup in a project directory without a Wrangler configuration file, Wrangler will:
- Detect your framework - Analyzes your project to identify the framework you're using
- Prompt for confirmation - Shows the detected settings and asks you to confirm before making changes
- Install adapters - Installs any required Cloudflare adapters for your framework
- Generate configuration - Creates a
wrangler.jsoncfile with appropriate settings - Update package.json - Adds helpful scripts like
deploy,preview, andcf-typegen - Configure git - Adds Wrangler-specific entries to
.gitignore
Automatic configuration supports the following frameworks:
| Framework | Adapter/Tool | Notes |
|---|---|---|
| Next.js | OpenNext or vinext | Wrangler configures OpenNext. cf init configures vinext for Next.js 16 and later. |
| Astro | @astrojs/cloudflare |
Runs astro add cloudflare automatically |
| SvelteKit | @sveltejs/adapter-cloudflare |
Runs sv add sveltekit-adapter automatically |
| Nuxt | Built-in Cloudflare preset | |
| React Router | Cloudflare Vite plugin | |
| Solid Start | Built-in Cloudflare preset | |
| TanStack Start | Cloudflare Vite plugin | |
| Angular | ||
| Analog | Built-in Cloudflare preset | |
| Vite | Cloudflare Vite plugin | |
| Vike | ||
| Waku | ||
| Static sites | None | Any directory with an index.html |
Automatic configuration may also work with other projects, such as React or Vue SPAs. Try running wrangler deploy or wrangler setup to see if your project is detected.
When automatic configuration runs, the following files may be created or modified:
A new Wrangler configuration file is created with settings appropriate for your framework:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "my-project",
"main": "dist/_worker.js/index.js",
"upload_source_maps": true,
// Set this to today's date
"compatibility_date": "2026-11-06",
"assets": {
"binding": "ASSETS",
"directory": "dist",
},
"observability": {
"enabled": true,
},
}"$schema" = "node_modules/wrangler/config-schema.json"
name = "my-project"
main = "dist/_worker.js/index.js"
upload_source_maps = true
# Set this to today's date
compatibility_date = "2026-11-06"
[assets]
binding = "ASSETS"
directory = "dist"
[observability]
enabled = trueThe exact configuration varies based on your framework. For compatibility dates before 2026-08-04, automatic configuration also adds the nodejs_compat compatibility flag.
New scripts are added to your package.json:
{
"scripts": {
"deploy": "npm run build && wrangler deploy",
"preview": "npm run build && wrangler dev",
"cf-typegen": "wrangler types"
}
}Wrangler-specific entries are added:
# wrangler files
.wrangler
.dev.vars*
!.dev.vars.exampleFor frameworks that generate worker files in the output directory, an .assetsignore file is created to exclude them from static asset uploads:
_worker.js
_routes.jsonTo deploy an existing project, run wrangler deploy in your project directory:
npx wrangler deployyarn wrangler deploypnpm wrangler deployWrangler will detect your framework, show the configuration it will apply, and prompt you to confirm before making changes and deploying.
To configure your project without deploying, use wrangler setup:
npx wrangler setupyarn wrangler setuppnpm wrangler setupThis is useful when you want to review the generated configuration before deploying.
To see what changes would be made without actually modifying any files:
npx wrangler setup --dry-runyarn wrangler setup --dry-runpnpm wrangler setup --dry-runThis outputs a summary of the configuration that would be generated.
To apply the detected configuration without confirming it, pass --yes to wrangler setup:
npx wrangler setup --yesyarn wrangler setup --yespnpm wrangler setup --yesThis is useful in CI/CD environments, or when you want to accept the detected settings without reviewing them.
When setup finishes, Wrangler prints the command to deploy with. In a project with a package.json, use the generated deploy script:
npm run deployyarn run deploypnpm run deployIf Wrangler detected a build command, the generated script runs it before deploying. In a project without a package.json, run wrangler deploy.
When you import a GitHub or GitLab repository via the Cloudflare dashboard, autoconfig runs non-interactively. If your repository does not have a Wrangler configuration file, Workers Builds will create a pull request with the necessary configuration.
The PR includes all the configuration changes described above. A preview deployment is generated so you can test the changes before merging. Once merged, your project is ready for deployment.
For more details, refer to Automatic pull requests.
If you do not want automatic configuration to run, ensure you have a valid Wrangler configuration file (wrangler.toml, wrangler.json, or wrangler.jsonc) in your project before running wrangler deploy.
You can also manually configure your project by following the framework-specific guides in the Framework guides.
The adapter that automatic configuration uses for Next.js depends on the tool you run:
| Tool | Next.js 16 and later | Next.js 15 and earlier |
|---|---|---|
wrangler setup or wrangler deploy |
OpenNext | OpenNext |
cf init |
vinext | OpenNext |
When automatic configuration uses vinext, it runs vinext init. The generated configuration adds the vinext and Vite dependencies, creates the Cloudflare Workers configuration, and adds package scripts for development, builds, and deployment. To use vinext with Wrangler, run vinext init directly. For more information, refer to Next.js.
vinext supports Next.js caching features such as Incremental Static Regeneration (ISR), "use cache", and unstable_cache. For production applications, configure the generated Workers project with the cache backend your application requires. For more information, refer to vinext caching ↗︎.
If you need the OpenNext adapter instead of vinext, configure it manually by following the OpenNext adapter guide.
When you import a repository via Workers Builds in the Cloudflare dashboard, automatic configuration will fail if your project contains multiple frameworks. To resolve this, set the root directory to the path containing only one framework. For monorepos, refer to monorepo setup.
When running wrangler deploy or wrangler setup locally, Wrangler will prompt you to select which framework to use if multiple frameworks are detected.
If your framework is not detected, ensure your package.json includes the framework as a dependency.
If a Wrangler configuration file already exists, automatic configuration will not run. To reconfigure your project, delete the existing configuration file and run wrangler deploy or wrangler setup again.
Support for monorepos and npm/yarn/pnpm workspaces is currently limited. Wrangler analyzes the project directory where you run the command, but does not detect dependencies installed at the workspace root. This can cause framework detection to fail if the framework is listed as a dependency in the workspace's root package.json rather than in the individual project's package.json.
If you encounter issues, report them in the Wrangler GitHub repository ↗︎.