From 1f16872b5c936ec1c4e85df3873afe86a7061482 Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Sat, 4 Jul 2026 21:14:06 -0700 Subject: [PATCH 1/7] [Workers, Containers] Document automatic configuration targets --- src/content/docs/containers/get-started.mdx | 12 +- src/content/docs/containers/index.mdx | 11 + .../containers/platform-details/rollouts.mdx | 10 + .../workers/ci-cd/builds/troubleshoot.mdx | 3 + .../ci-cd/external-cicd/github-actions.mdx | 8 +- .../ci-cd/external-cicd/gitlab-cicd.mdx | 9 +- .../automatic-configuration.mdx | 239 +++++++++++++++--- .../framework-guides/web-apps/react.mdx | 2 + .../workers/framework-guides/web-apps/vue.mdx | 54 ++-- .../docs/workers/runtime-apis/nodejs/http.mdx | 2 + .../docs/workers/static-assets/binding.mdx | 4 +- .../workers/static-assets/get-started.mdx | 22 ++ .../docs/workers/static-assets/index.mdx | 4 +- .../migration-guides/migrate-from-pages.mdx | 44 ++-- .../migration-guides/netlify-to-workers.mdx | 10 +- .../migration-guides/vercel-to-workers.mdx | 8 +- .../tutorials/deploy-an-express-app.mdx | 12 + .../docs/workers/vite-plugin/index.mdx | 2 + .../docs/workers/vite-plugin/tutorial.mdx | 3 + .../workers/wrangler/commands/workers.mdx | 27 +- .../docs/workers/wrangler/configuration.mdx | 93 +++---- 21 files changed, 435 insertions(+), 144 deletions(-) diff --git a/src/content/docs/containers/get-started.mdx b/src/content/docs/containers/get-started.mdx index 7dfbf6311d6..5e6bcfaa94c 100644 --- a/src/content/docs/containers/get-started.mdx +++ b/src/content/docs/containers/get-started.mdx @@ -29,6 +29,16 @@ In this guide, we will build and push a container image alongside your Worker co ## Deploy your first Container +If you already have a project with a `Dockerfile` or `Containerfile`, Wrangler can generate a singleton Containers Worker for you: + + + +In CI, pass the `Dockerfile` or `Containerfile` target explicitly with `--experimental-auto-config-containers`, or run `wrangler setup --yes --experimental-auto-config-containers` before deploying. After Wrangler configures the project, use `wrangler deploy` for future deploys. Continue with the starter template to create a new Containers project. + Run the following command to create and deploy a new Worker with a container, from the starter template: @@ -38,6 +39,16 @@ Run code written in any programming language, built for any runtime, as part of Deploy your container image to `Region:Earth` without worrying about managing infrastructure - just define your Worker and [`wrangler deploy`](/workers/wrangler/commands/general/#deploy). +If you already have a `Dockerfile` or `Containerfile`, Wrangler can generate a singleton Containers Worker for you: + + + +In CI, pass the `Dockerfile` or `Containerfile` target explicitly with `--experimental-auto-config-containers`, or use `wrangler setup --yes --experimental-auto-config-containers` before deploying. + With Containers you can run: - Resource-intensive applications that require CPU cores running in parallel, large amounts of memory or disk space diff --git a/src/content/docs/containers/platform-details/rollouts.mdx b/src/content/docs/containers/platform-details/rollouts.mdx index f321d2d246e..7191f83d880 100644 --- a/src/content/docs/containers/platform-details/rollouts.mdx +++ b/src/content/docs/containers/platform-details/rollouts.mdx @@ -73,3 +73,13 @@ If you need to do a one-off deployment that rolls out to 100% of container insta /> Note that `rollout_active_grace_period`, if configured, will still apply. + +## Skip Container updates + +To deploy Worker code changes without building or updating Containers, deploy with: + + diff --git a/src/content/docs/workers/ci-cd/builds/troubleshoot.mdx b/src/content/docs/workers/ci-cd/builds/troubleshoot.mdx index 19e65105b5e..7d45a779e5e 100644 --- a/src/content/docs/workers/ci-cd/builds/troubleshoot.mdx +++ b/src/content/docs/workers/ci-cd/builds/troubleshoot.mdx @@ -35,6 +35,9 @@ On Wrangler v3 and up, Workers Builds automatically matches the name of the conn `✘ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. wrangler deploy path/to/script) or the main config field.` If you see this error, a Wrangler configuration file is likely missing from the root directory. Navigate to **Settings** > **Build** > **Build Configuration** to update the root directory, or add a [Wrangler configuration file](/workers/wrangler/configuration/) to the specified directory. + +For supported frameworks and project types, Wrangler can [configure your project automatically](/workers/framework-guides/automatic-configuration/). If your repository does not have a Wrangler configuration file, confirm that your deploy command runs from the project root and uses `npx wrangler deploy --yes`. If you deploy an explicit static directory, use `npx wrangler deploy ./site --experimental-auto-config-static-assets`. For Dockerfile-backed Containers, use `npx wrangler deploy Dockerfile --experimental-auto-config-containers` or `npx wrangler setup --yes --experimental-auto-config-containers`. Bare Dockerfile detection is not used in CI. + ### Incorrect account_id `Could not route to /client/v4/accounts//workers/services/, perhaps your object identifier is invalid? [code: 7003]` diff --git a/src/content/docs/workers/ci-cd/external-cicd/github-actions.mdx b/src/content/docs/workers/ci-cd/external-cicd/github-actions.mdx index 2eae230b361..c5cfbce583a 100644 --- a/src/content/docs/workers/ci-cd/external-cicd/github-actions.mdx +++ b/src/content/docs/workers/ci-cd/external-cicd/github-actions.mdx @@ -5,6 +5,7 @@ description: Integrate Workers development into your existing GitHub Actions wor products: - workers --- + import { DashButton } from "~/components"; You can deploy Workers with [GitHub Actions](https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler). Here is how you can set up your GitHub Actions workflow. @@ -20,6 +21,7 @@ To find your Cloudflare account ID, refer to [Find account and zone IDs](/fundam ### API token To create an API token to authenticate Wrangler in your CI job: + 1. In the Cloudflare dashboard, go to the **Account API tokens** page. @@ -44,10 +46,12 @@ To set up your CI/CD: :::caution -Don't store the value of `CLOUDFLARE_API_TOKEN` in your repository, as it gives access to deploy Workers on your account. Instead, you should utilize your CI/CD provider's support for storing secrets. +Do not store the value of `CLOUDFLARE_API_TOKEN` in your repository. It gives access to deploy Workers on your account. Instead, use your CI/CD provider's support for storing secrets. ::: -2. Create a workflow that will be responsible for deploying the Worker. This workflow should run `wrangler deploy`. Review an example [GitHub Actions](https://docs.github.com/en/actions/using-workflows/about-workflows) workflow in the follow section. +2. Create a workflow that runs `wrangler deploy`. Review an example [GitHub Actions](https://docs.github.com/en/actions/using-workflows/about-workflows) workflow in the following section. + +If your repository does not have a Wrangler configuration file and uses [automatic project configuration](/workers/framework-guides/automatic-configuration/), run `wrangler deploy --yes` in CI. For Dockerfile-backed Containers, pass the Dockerfile or Containerfile target with `--experimental-auto-config-containers`, or run `wrangler setup --yes --experimental-auto-config-containers` before deploying. Bare Dockerfile detection is not used in CI. ### GitHub Actions diff --git a/src/content/docs/workers/ci-cd/external-cicd/gitlab-cicd.mdx b/src/content/docs/workers/ci-cd/external-cicd/gitlab-cicd.mdx index ad35eea9bad..5dde10171ed 100644 --- a/src/content/docs/workers/ci-cd/external-cicd/gitlab-cicd.mdx +++ b/src/content/docs/workers/ci-cd/external-cicd/gitlab-cicd.mdx @@ -5,9 +5,10 @@ description: Integrate Workers development into your existing GitLab Pipelines w products: - workers --- + import { DashButton } from "~/components"; -You can deploy Workers with [GitLab CI/CD](https://docs.gitlab.com/ee/ci/pipelines/index.html). Here is how you can set up your Gitlab CI/CD pipeline. +You can deploy Workers with [GitLab CI/CD](https://docs.gitlab.com/ee/ci/pipelines/index.html). Here is how you can set up your GitLab CI/CD pipeline. ## 1. Authentication @@ -45,10 +46,12 @@ To set up your CI: :::caution -Don't store the value of `CLOUDFLARE_API_TOKEN` in your repository, as it gives access to deploy Workers on your account. Instead, you should utilize your CI/CD provider's support for storing secrets. +Do not store the value of `CLOUDFLARE_API_TOKEN` in your repository. It gives access to deploy Workers on your account. Instead, use your CI/CD provider's support for storing secrets. ::: -2. Create a workflow that will be responsible for deploying the Worker. This workflow should run `wrangler deploy`. Review an example [GitHub Actions](https://docs.github.com/en/actions/using-workflows/about-workflows) workflow in the following section. +2. Create a workflow that runs `wrangler deploy`. Review an example GitLab pipeline in the following section. + +If your repository does not have a Wrangler configuration file and uses [automatic project configuration](/workers/framework-guides/automatic-configuration/), run `wrangler deploy --yes` in CI. For Dockerfile-backed Containers, pass the Dockerfile or Containerfile target with `--experimental-auto-config-containers`, or run `wrangler setup --yes --experimental-auto-config-containers` before deploying. Bare Dockerfile detection is not used in CI. ### GitLab Pipelines diff --git a/src/content/docs/workers/framework-guides/automatic-configuration.mdx b/src/content/docs/workers/framework-guides/automatic-configuration.mdx index ebc8afc18f6..fcd199c838a 100644 --- a/src/content/docs/workers/framework-guides/automatic-configuration.mdx +++ b/src/content/docs/workers/framework-guides/automatic-configuration.mdx @@ -10,52 +10,82 @@ products: import { PackageManagers, WranglerConfig } from "~/components"; -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. +Wrangler can automatically detect your framework, project type, or deploy target and configure your project for Cloudflare Workers. You can deploy existing projects with a single command, without manually setting up configuration files or installing adapters. :::note -Minimum required Wrangler version: **4.68.0**. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/). +Minimum required Wrangler version: **4.108.0**. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](/workers/wrangler/install-and-update/). ::: ## How it works -When you run `wrangler deploy` or `wrangler setup` in a project directory without a Wrangler configuration file, Wrangler will: +Automatic configuration can run when you run `wrangler deploy` or `wrangler setup` in a project directory without a Wrangler configuration file. It can also run when you deploy a specific target, such as `wrangler deploy server.js`, if Wrangler can identify that target. -1. **Detect your framework** - Analyzes your project to identify the framework you're using -2. **Prompt for confirmation** - Shows the detected settings and asks you to confirm before making changes -3. **Install adapters** - Installs any required Cloudflare adapters for your framework -4. **Generate configuration** - Creates a `wrangler.jsonc` file with appropriate settings -5. **Update package.json** - Adds helpful scripts like `deploy`, `preview`, and `cf-typegen` -6. **Configure git** - Adds Wrangler-specific entries to `.gitignore` +For persistent configuration, Wrangler will: -## Supported frameworks +1. **Detect your framework**: Wrangler analyzes your project to identify the framework you are using. +2. **Prompt for confirmation**: Wrangler shows the detected settings and asks you to confirm changes. +3. **Install adapters**: Wrangler installs any required Cloudflare adapters for your framework. +4. **Generate configuration**: Wrangler creates a `wrangler.jsonc` file with appropriate settings. +5. **Update `package.json`**: Wrangler adds helpful scripts like `deploy`, `preview`, and `cf-typegen`. +6. **Configure git**: Wrangler adds Wrangler-specific entries to `.gitignore`. + +Some explicit deploy targets use no-write mode. In no-write mode, Wrangler deploys the target without creating or modifying local project files. + +## Supported projects + +### Frameworks Automatic configuration supports the following frameworks: -| Framework | Adapter/Tool | Notes | +| Framework | Adapter or tool | Notes | | ---------------------------------------------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------- | | [Next.js](/workers/framework-guides/web-apps/nextjs/) | `@opennextjs/cloudflare` | Runs `@opennextjs/cloudflare migrate` automatically. [R2 caching](#nextjs-caching) is configured if available. | | [Astro](/workers/framework-guides/web-apps/astro/) | `@astrojs/cloudflare` | Runs `astro add cloudflare` automatically | | [SvelteKit](/workers/framework-guides/web-apps/sveltekit/) | `@sveltejs/adapter-cloudflare` | Runs `sv add sveltekit-adapter` automatically | -| [Nuxt](/workers/framework-guides/web-apps/more-web-frameworks/nuxt/) | Built-in Cloudflare preset | | -| [React Router](/workers/framework-guides/web-apps/react-router/) | Cloudflare Vite plugin | | -| [Solid Start](/workers/framework-guides/web-apps/more-web-frameworks/solid/) | Built-in Cloudflare preset | | -| [TanStack Start](/workers/framework-guides/web-apps/tanstack-start/) | Cloudflare Vite plugin | | -| [Angular](/workers/framework-guides/web-apps/more-web-frameworks/angular/) | | | -| [Analog](/workers/framework-guides/web-apps/more-web-frameworks/analog/) | Built-in Cloudflare preset | | -| [Vite](/workers/vite-plugin/) | Cloudflare Vite plugin | | -| [Vike](/workers/framework-guides/web-apps/vike/) | | | -| [Waku](/workers/framework-guides/web-apps/more-web-frameworks/waku/) | | | +| [Nuxt](/workers/framework-guides/web-apps/more-web-frameworks/nuxt/) | Built-in Cloudflare preset | None | +| [React Router](/workers/framework-guides/web-apps/react-router/) | Cloudflare Vite plugin | None | +| [Solid Start](/workers/framework-guides/web-apps/more-web-frameworks/solid/) | Built-in Cloudflare preset | None | +| [TanStack Start](/workers/framework-guides/web-apps/tanstack-start/) | Cloudflare Vite plugin | None | +| [Angular](/workers/framework-guides/web-apps/more-web-frameworks/angular/) | None | None | +| [Analog](/workers/framework-guides/web-apps/more-web-frameworks/analog/) | Built-in Cloudflare preset | None | +| [Vite](/workers/vite-plugin/) | Cloudflare Vite plugin | None | +| [Vike](/workers/framework-guides/web-apps/vike/) | None | None | +| [Waku](/workers/framework-guides/web-apps/more-web-frameworks/waku/) | None | None | | 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. +The Static sites row applies when the current project directory or detected output directory contains an `index.html` file. Explicit static directory targets use the static assets flag described in [Other project types](#other-project-types). + +### Other project types + +Automatic configuration also supports the following project types and deploy targets: + +| Project type | Configuration mode | Notes | +| ------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Express-style Node HTTP servers | Persistent | Run `wrangler deploy`, `wrangler setup`, or pass a JavaScript or TypeScript target such as `server.js`. Wrangler detects an Express dependency, import, or `express()` call, then checks that the app listens for HTTP traffic or exports the app. | +| Single HTML files | No-write | Pass an `.html` file to `wrangler deploy`. Wrangler deploys the file as static assets. If the file is not named `index.html`, Wrangler also preserves the original filename. | +| Static asset directories | No-write | Pass a directory with `--experimental-auto-config-static-assets`. The target directory must contain an `index.html` file. This path is experimental and only runs when you pass the flag. | +| Static Vite app directories | No-write | Pass a directory with `--experimental-auto-config-static-assets`. The target directory must include a `package.json` with a `vite` dependency and a `build` script. Wrangler runs the build command, verifies that `dist/index.html` exists, and deploys `dist`. This path is experimental and only runs when you pass the flag. | +| Dockerfile-backed Containers | Persistent | Pass `Dockerfile` or `Containerfile` with `--experimental-auto-config-containers`, or run `wrangler setup --experimental-auto-config-containers`. Wrangler generates a singleton Containers Worker. Containers require Docker locally and a Workers Paid plan. This path is experimental and only runs when you pass the flag. | + ## Files created and modified -When automatic configuration runs, the following files may be created or modified: +For no-write deploys, Wrangler does not create or modify local project files. + +For persistent configuration, the following files may be created or modified: + +### `src/worker.js` or `src/worker.ts` + +For Express-style Node HTTP servers and Dockerfile-backed Containers, Wrangler generates a Worker entrypoint. This wrapper adapts the existing app to the Workers runtime. + +For Express apps, the generated Worker imports your server file and uses `cloudflare:node` to serve it. If Wrangler detects `express.static()`, static assets are not migrated automatically. Configure [Workers Static Assets](/workers/static-assets/) separately if your Express app serves static files. If Wrangler detects Node HTTP upgrade or WebSocket patterns, you may need to migrate those routes to Worker-native WebSocket handling. + +For Containers, the generated Worker imports `@cloudflare/containers`, defines a `Container` class, and routes requests to one container instance. The generated Wrangler configuration also includes the `containers`, `durable_objects`, and `migrations` fields required for the Container. ### `wrangler.jsonc` -A new Wrangler configuration file is created with settings appropriate for your framework: +A new Wrangler configuration file is created with settings appropriate for your framework or project type: @@ -78,11 +108,13 @@ A new Wrangler configuration file is created with settings appropriate for your -The exact configuration varies based on your framework. +The exact configuration varies based on your framework or project type. + +For Express-style Node HTTP servers, `wrangler.jsonc` sets `main` to the generated Worker wrapper and adds the `nodejs_compat` compatibility flag. For Containers, `wrangler.jsonc` includes the generated Container, Durable Object binding, and migration configuration. ### `package.json` -New scripts are added to your `package.json`: +New dependencies and scripts may be added to your `package.json`. For example, Dockerfile-backed Containers add `@cloudflare/containers`. For a framework project, scripts can look like: ```json { @@ -118,20 +150,88 @@ _routes.json ### Deploy with automatic configuration -To deploy an existing project, run [`wrangler deploy`](/workers/wrangler/commands/general/#deploy) in your project directory: +To deploy an existing project, run [`wrangler deploy`](/workers/wrangler/commands/workers/#deploy) in your project directory: -Wrangler will detect your framework, show the configuration it will apply, and prompt you to confirm before making changes and deploying. +Wrangler will detect your framework or project type, show the configuration it will apply, and prompt you to confirm before making changes and deploying. + +### Deploy a specific target + +To deploy an explicit target, pass the target path to [`wrangler deploy`](/workers/wrangler/commands/workers/#deploy): + + + +You can use explicit targets for Express-style Node HTTP servers, single HTML files, static asset directories, static Vite app directories, Dockerfiles, and Containerfiles. + +To deploy a standalone HTML file without creating a `wrangler.jsonc` file, pass the HTML file directly: + +"} +/> + +If you deploy a named HTML file, Wrangler serves it at `/` and at its original filename. For example, `wrangler deploy landing.html` serves the same file at `/` and `/landing.html`. + +To deploy an Express-style Node HTTP server, pass the server entrypoint directly: + +"} +/> + +Wrangler generates a Worker wrapper in `src/worker.js` or `src/worker.ts`. It uses Node.js compatibility and the detected HTTP port. If Wrangler cannot detect a port, it uses port `3000`. + +Wrangler refuses to overwrite an existing generated entrypoint, such as `src/worker.js` or `src/worker.ts`. Move or remove that file before trying again. + +For Dockerfile-backed Containers, pass the Containers auto-configuration flag with a `Dockerfile` or `Containerfile` target: + + + +After Wrangler configures a Containers project, use `wrangler deploy` for future deploys. Do not continue passing `Dockerfile` or `Containerfile` as the deploy target. + +For explicit static directories or static Vite app directories, pass the static assets auto-configuration flag: + + + +For a static assets directory, Wrangler deploys the target directory without writing `wrangler.jsonc`. For a static Vite app directory, Wrangler runs the build command, verifies that `dist/index.html` exists, and deploys `dist`. If `dist/index.html` is missing after the build, check your build command or deploy the output directory explicitly with `--assets`. + +To deploy a static Vite app directory, pass the app directory with the same flag: + + + +When Wrangler deploys assets, it ignores `.wrangler/**`. If `WRANGLER_OUTPUT_FILE_PATH` points inside the assets directory, Wrangler warns and ignores that output file. ### Configure without deploying -To configure your project without deploying, use [`wrangler setup`](/workers/wrangler/commands/general/#setup): +To configure your project without deploying, use [`wrangler setup`](/workers/wrangler/commands/workers/#setup): This is useful when you want to review the generated configuration before deploying. +To configure a Dockerfile-backed Containers project without deploying, pass the Containers flag: + + + ### Preview changes with dry run To see what changes would be made without actually modifying any files: @@ -142,19 +242,62 @@ This outputs a summary of the configuration that would be generated. ## Non-interactive mode -To skip the confirmation prompts, use the [`--yes` flag](/workers/wrangler/commands/general/#deploy): +To skip the confirmation prompts, use the [`--yes` flag](/workers/wrangler/commands/workers/#deploy): -This applies the configuration automatically using sensible defaults. This is useful in CI/CD environments or when you want to accept the detected settings without reviewing them. +This applies the configuration automatically using detected defaults. This is useful in CI/CD environments or when you want to accept the detected settings without reviewing them. + +Dockerfile-backed Containers require an explicit opt-in for non-interactive configuration. Use one of the following commands: + + + + + +In CI, pass the Dockerfile or Containerfile target explicitly with `--experimental-auto-config-containers`, or use `wrangler setup --yes --experimental-auto-config-containers`. Bare Dockerfile detection is not used in non-interactive sessions. + +## Automation output + +If you write Wrangler output to a file, automatic configuration entries include adapter metadata. For more information about output files, refer to [System environment variables](/workers/wrangler/system-environment-variables/#supported-environment-variables). + +Automatic configuration output includes: + +| Field | Description | +| ---------------- | ------------------------------------------------- | +| `adapterId` | The adapter Wrangler selected | +| `projectKind` | The detected project type | +| `deployMode` | `persistent` or `no-write` | +| `sourceCategory` | The detected source category, such as `html-file` | + +Deploy output can also include: + +| Field | Description | +| ----------------------------- | --------------------------------------- | +| `auto_config_adapter_id` | The selected auto-configuration adapter | +| `auto_config_project_kind` | The detected project type | +| `auto_config_deploy_mode` | `persistent` or `no-write` | +| `auto_config_source_category` | The detected source category | +| `live_url` | The deployed Worker URL, when available | + +Container deploy output includes `containers_rollout` and `containers` fields. `containers_rollout` can be `gradual`, `immediate`, or `none`. Each `containers` entry describes a container application, including the app name, application ID, action, image, and image digest. The action can be `created`, `modified`, or `unchanged`. Wrangler reports `unchanged` when the local image matches the remote image and the push is skipped. ## Importing a repository from the dashboard -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](/workers/ci-cd/builds/) will create a pull request with the necessary configuration. +When you import a GitHub or GitLab repository via the Cloudflare dashboard, automatic configuration runs non-interactively. If your repository does not have a Wrangler configuration file, [Workers Builds](/workers/ci-cd/builds/) will create a pull request with the necessary configuration. + +Experimental static asset directory and Dockerfile-backed Containers paths require explicit Wrangler flags, and are not used by default during dashboard import. 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](/workers/ci-cd/builds/automatic-prs/). +For more information, refer to [Automatic pull requests](/workers/ci-cd/builds/automatic-prs/). ## Skipping automatic configuration @@ -187,8 +330,40 @@ If your framework is not detected, ensure your `package.json` includes the frame 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. +For configured Containers projects, run `wrangler deploy` to deploy the Worker and configured container together. Running `wrangler deploy Dockerfile` or `wrangler deploy Containerfile` treats the file as a Worker entrypoint and is not supported. + +### Generated file already exists + +Wrangler will not overwrite files it generates for adapter-based configuration. If you see an error such as `Refusing to overwrite generated file src/worker.js`, move or remove the existing file and try again. + +### Static app output missing + +For static Vite app directories, Wrangler expects the build command to create `dist/index.html`. If the file is missing after build, check your build command or deploy the output directory explicitly with `--assets`. + +### Dockerfile port detection + +For Dockerfile-backed Containers, Wrangler detects the Container port from your Dockerfile. If the Dockerfile has one `EXPOSE` value, Wrangler uses it. If the Dockerfile does not have exactly one `EXPOSE` value but `ENV PORT=` is set, Wrangler uses that value. If there are multiple `EXPOSE` values and no `ENV PORT=`, Wrangler uses the first `EXPOSE` value and warns you. If no port is detected, Wrangler uses port `80` and warns you. Update the generated Worker if your container listens on a different port. + +### Container readiness + +After Wrangler creates or modifies a container application, the application can take a few minutes to become ready. During provisioning, requests may return `503` or `500`. Wrangler prints a status command after deploy. + +To list container applications with health details, run: + + + +To inspect instance placement and status details, run: + + --json"} +/> + +Use the application ID from `wrangler containers list --json`. If instances are stopped or unhealthy, non-JSON output suggests the JSON command for more details. + ### Workspaces -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`. +Support for monorepos and npm/yarn/pnpm workspaces is 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 root `package.json` for the workspace rather than in the individual project `package.json`. If you encounter issues, report them in the [Wrangler GitHub repository](https://github.com/cloudflare/workers-sdk/issues/new/choose). diff --git a/src/content/docs/workers/framework-guides/web-apps/react.mdx b/src/content/docs/workers/framework-guides/web-apps/react.mdx index 169d6985855..0a12fa77223 100644 --- a/src/content/docs/workers/framework-guides/web-apps/react.mdx +++ b/src/content/docs/workers/framework-guides/web-apps/react.mdx @@ -33,6 +33,8 @@ import { [![Deploy to Workers](https://deploy.workers.cloudflare.com/button)](https://dash.cloudflare.com/?to=/:account/workers-and-pages/create/deploy-to-workers&repository=https://github.com/cloudflare/templates/tree/main/vite-react-template) +If you already have a React app built with Vite and do not need a Worker API, Wrangler can deploy it with the experimental static assets auto-configuration flag. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). + ## What is React? [React](https://react.dev/) is a framework for building user interfaces. It allows you to create reusable UI components and manage the state of your application efficiently. You can use React to build a single-page application (SPA), and combine it with a backend API running on Cloudflare Workers to create a full-stack application. diff --git a/src/content/docs/workers/framework-guides/web-apps/vue.mdx b/src/content/docs/workers/framework-guides/web-apps/vue.mdx index e3f18d090e9..a9a01574865 100644 --- a/src/content/docs/workers/framework-guides/web-apps/vue.mdx +++ b/src/content/docs/workers/framework-guides/web-apps/vue.mdx @@ -22,6 +22,8 @@ import { In this guide, you will create a new [Vue](https://vuejs.org/) application and deploy to Cloudflare Workers (with the new [Workers Assets](/workers/static-assets/)). +If you already have a Vue app built with Vite and do not need a Worker API, Wrangler can deploy it with the experimental static assets auto-configuration flag. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). + ## 1. Set up a new project Use the [`create-cloudflare`](https://www.npmjs.com/package/create-cloudflare) CLI (C3) to set up a new project. C3 will create a new project directory, use code from the official Vue template, and provide the option to deploy instantly. @@ -34,30 +36,34 @@ To use `create-cloudflare` to create a new Vue project with Workers Assets, run args="my-vue-app --framework=vue" /> -
- Below is a simplified file tree of the project. - - - my-vue-app - - src/ - - App.vue - - server/ - - index.ts - - index.html - - vite.config.ts - - wrangler.jsonc - - - `wrangler.jsonc` is your [Wrangler configuration file](/workers/wrangler/configuration/). - In this file: - - `main` points to `server/index.ts`. This is your Worker, which is going to act as your backend API. - - `assets.not_found_handling` is set to `single-page-application`, which means that routes that are handled by your Vue SPA do not go to the Worker, and are thus free. - - If you want to add bindings to resources on Cloudflare's developer platform, you configure them here. Read more about [bindings](/workers/runtime-apis/bindings/). - - `vite.config.ts` is set up to use the [Cloudflare Vite plugin](/workers/vite-plugin/). This runs your Worker in the Cloudflare Workers runtime, ensuring your local development environment is as close to production as possible. - - `server/index.ts` is your backend API, which contains a single endpoint, `/api/`, that returns a text response. - At `src/App.vue`, your Vue app calls this endpoint to get a message back and displays this. -
+
+ +Below is a simplified file tree of the project. + + + +- my-vue-app + - src/ + - App.vue + - server/ + - index.ts + - index.html + - vite.config.ts + - wrangler.jsonc + + + +`wrangler.jsonc` is your [Wrangler configuration file](/workers/wrangler/configuration/). In this file: + +- `main` points to `server/index.ts`. This is your Worker, which acts as your backend API. +- `assets.not_found_handling` is set to `single-page-application`. Routes handled by your Vue SPA do not go to the Worker, and are free. +- Bindings to resources on Cloudflare's developer platform are configured here. For more information, refer to [Bindings](/workers/runtime-apis/bindings/). + +`vite.config.ts` is set up to use the [Cloudflare Vite plugin](/workers/vite-plugin/). This runs your Worker in the Cloudflare Workers runtime, ensuring your local development environment is as close to production as possible. + +`server/index.ts` is your backend API, which contains a single endpoint, `/api/`, that returns a text response. At `src/App.vue`, your Vue app calls this endpoint to get a message back and displays this. + +
## 2. Develop locally with the [Cloudflare Vite plugin](/workers/vite-plugin/) diff --git a/src/content/docs/workers/runtime-apis/nodejs/http.mdx b/src/content/docs/workers/runtime-apis/nodejs/http.mdx index 703b5a2a71b..41fce395bf5 100644 --- a/src/content/docs/workers/runtime-apis/nodejs/http.mdx +++ b/src/content/docs/workers/runtime-apis/nodejs/http.mdx @@ -249,6 +249,8 @@ export default httpServerHandler({ port: 8080 }); The `httpServerHandler` function integrates Node.js HTTP servers with the Cloudflare Workers request model. It supports two API patterns: +If you already have an Express-style Node HTTP server, Wrangler can generate the Worker wrapper and Node.js compatibility configuration for you. Static assets and WebSocket routes may require manual migration. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). + ```js import http from "node:http"; import { httpServerHandler } from "cloudflare:node"; diff --git a/src/content/docs/workers/static-assets/binding.mdx b/src/content/docs/workers/static-assets/binding.mdx index 42452e45ac8..1bb80b33950 100644 --- a/src/content/docs/workers/static-assets/binding.mdx +++ b/src/content/docs/workers/static-assets/binding.mdx @@ -22,7 +22,9 @@ import { WranglerConfig, } from "~/components"; -Configuring a Worker with assets requires specifying a [directory](/workers/static-assets/binding/#directory) and, optionally, an [assets binding](/workers/static-assets/binding/), in your Worker's Wrangler file. The [assets binding](/workers/static-assets/binding/) allows you to dynamically fetch assets from within your Worker script (e.g. `env.ASSETS.fetch()`), similarly to how you might with a make a `fetch()` call with a [Service binding](/workers/runtime-apis/bindings/service-bindings/http/). +When you use persistent Worker configuration, configure assets by specifying a [directory](/workers/static-assets/binding/#directory) and, optionally, an [assets binding](/workers/static-assets/binding/), in your Worker's Wrangler file. The [assets binding](/workers/static-assets/binding/) allows you to dynamically fetch assets from within your Worker script, for example `env.ASSETS.fetch()`, similar to making a `fetch()` call with a [Service binding](/workers/runtime-apis/bindings/service-bindings/http/). + +Wrangler can also deploy some static asset targets without creating a persistent Wrangler configuration file. Static directories and static Vite apps require the experimental static assets auto-configuration flag. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). Only one collection of static assets can be configured in each Worker. diff --git a/src/content/docs/workers/static-assets/get-started.mdx b/src/content/docs/workers/static-assets/get-started.mdx index 64d47cdc9e3..3b78967fa1d 100644 --- a/src/content/docs/workers/static-assets/get-started.mdx +++ b/src/content/docs/workers/static-assets/get-started.mdx @@ -29,6 +29,28 @@ Alternatively, you may prefer to build your website from scratch if: This guide will instruct you through setting up and deploying a static site or a full-stack application without a framework on Workers. +## Deploy existing static assets + +If you already have a standalone HTML file, Wrangler can deploy it directly. Pass the file to `wrangler deploy`: + +"} +/> + +For an existing static directory or static Vite app directory, pass the directory with the experimental static assets auto-configuration flag: + + + +For a static Vite app directory, Wrangler runs the build command and deploys `dist`. The build output must contain `dist/index.html`. + +For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/). + ## Deploy a static site This guide will instruct you through setting up and deploying a static site on Workers. diff --git a/src/content/docs/workers/static-assets/index.mdx b/src/content/docs/workers/static-assets/index.mdx index a772d4bde2f..5dba96d41d9 100644 --- a/src/content/docs/workers/static-assets/index.mdx +++ b/src/content/docs/workers/static-assets/index.mdx @@ -58,7 +58,9 @@ Learn more about supported frameworks on Workers. When you deploy your project, Cloudflare deploys both your Worker code and your static assets in a single operation. This deployment operates as a tightly integrated "unit" running across Cloudflare's network, combining static file hosting, custom logic, and global caching. -The **assets directory** specified in your [Wrangler configuration file](/workers/wrangler/configuration/#assets) is central to this design. During deployment, Wrangler automatically uploads the files from this directory to Cloudflare's infrastructure. Once deployed, requests for these assets are routed efficiently to locations closest to your users. +For projects with persistent configuration, the **assets directory** specified in your [Wrangler configuration file](/workers/wrangler/configuration/#assets) is central to this design. During deployment, Wrangler automatically uploads the files from this directory to Cloudflare's infrastructure. Once deployed, requests for these assets are routed efficiently to locations closest to your users. + +If you already have a standalone HTML file, Wrangler can deploy it without creating a Wrangler configuration file. Static directories and static Vite apps can use the experimental static assets auto-configuration flag. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). diff --git a/src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx b/src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx index 153b233bbcf..f7d7f8ab44d 100644 --- a/src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx +++ b/src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx @@ -32,6 +32,12 @@ Unlike Pages, Workers has a distinctly broader set of features available to it, Migrating from Cloudflare Pages to Cloudflare Workers is often a straightforward process. The following are some of the most common steps you will need to take to migrate your project. +For supported frameworks and project types, Wrangler can [configure or deploy your project automatically](/workers/framework-guides/automatic-configuration/). From your project root, run: + + + +If Wrangler detects your project, review the generated configuration before deploying. Continue with the manual migration steps if you need to migrate Pages Functions, adjust static asset routing, or configure an unsupported project. + ### Frameworks If your Pages project uses [a popular framework](/workers/framework-guides/), most frameworks already have adapters available for Cloudflare Workers. Switch out any Pages-specific adapters for the Workers equivalent and follow any guidance that they provide. @@ -321,27 +327,25 @@ If you are using Pages' built-in CI/CD system, you can swap this for Workers Bui Pages automatically creates a preview environment for each project, and can be independently configured. -To get a similar experience in Workers, you must: - -1. Ensure [preview URLs](/workers/versions-and-deployments/preview-urls/) are enabled (they are on by default). +To get a similar experience in Workers, ensure [preview URLs](/workers/versions-and-deployments/preview-urls/) are enabled. They are on by default. - + - ```json - { - "name": "my-worker", - "compatibility_date": "$today", - "main": "./worker/index.ts", - "assets": { - "directory": "./dist/client/" - }, - "preview_urls": true - } - ``` +```json +{ + "name": "my-worker", + "compatibility_date": "$today", + "main": "./worker/index.ts", + "assets": { + "directory": "./dist/client/" + }, + "preview_urls": true +} +``` - + -1. [Enable non-production branch builds](/workers/ci-cd/builds/build-branches/#configure-non-production-branch-builds) in Workers Builds. +Then, [enable non-production branch builds](/workers/ci-cd/builds/build-branches/#configure-non-production-branch-builds) in Workers Builds. Optionally, you can also [protect these preview URLs with Cloudflare Access](/workers/versions-and-deployments/preview-urls/#manage-access-to-preview-urls). @@ -412,11 +416,11 @@ This compatibility matrix compares the features of Workers and Pages. Unless oth | ----------------------------------------------------------------------------------------------------------- | ------- | ------- | | **Writing, Testing, and Deploying Code** | | | | [Cloudflare Vite plugin](/workers/vite-plugin/) | ✅ | ❌ | -| [Rollbacks](/workers/versions-and-deployments/rollbacks/) | ✅ | ✅ | -| [Gradual Deployments](/workers/versions-and-deployments/) | ✅ | ❌ | +| [Rollbacks](/workers/versions-and-deployments/rollbacks/) | ✅ | ✅ | +| [Gradual Deployments](/workers/versions-and-deployments/) | ✅ | ❌ | | [Preview URLs](/workers/versions-and-deployments/preview-urls/) | ✅ | ✅ | | [Testing tools](/workers/testing) | ✅ | ✅ | -| [Local Development](/workers/local-development/) | ✅ | ✅ | +| [Local Development](/workers/local-development/) | ✅ | ✅ | | [Remote Development (`--remote`)](/workers/wrangler/commands/) | ✅ | ❌ | | [Quick Editor in Dashboard](https://blog.cloudflare.com/improved-quick-edit) | ✅ | ❌ | | **Static Assets** | | | diff --git a/src/content/docs/workers/static-assets/migration-guides/netlify-to-workers.mdx b/src/content/docs/workers/static-assets/migration-guides/netlify-to-workers.mdx index 149ac21e506..4e825f2ff47 100644 --- a/src/content/docs/workers/static-assets/migration-guides/netlify-to-workers.mdx +++ b/src/content/docs/workers/static-assets/migration-guides/netlify-to-workers.mdx @@ -4,12 +4,12 @@ difficulty: Beginner pcx_content_type: tutorial title: Migrate from Netlify to Workers description: >- - Migrate your Netlify application to Cloudflare Workers. You should already have an existing project deployed on Netlified that you would like to host on Workers. + Migrate your Netlify application to Cloudflare Workers. You should already have an existing project deployed on Netlify that you would like to host on Workers. products: - workers --- -import { WranglerConfig } from "~/components"; +import { PackageManagers, WranglerConfig } from "~/components"; In this tutorial, you will learn how to migrate your Netlify application to Cloudflare Workers. @@ -19,6 +19,12 @@ You should already have an existing project deployed on Netlify that you would l Some frameworks like Next.js, Astro with on demand rendering, and others have specific guides for migrating to Cloudflare Workers. Refer to our [framework guides](/workers/framework-guides/) for more information. If your framework has a **Deploy an existing project on Workers** guide, follow that guide for specific instructions. Otherwise, continue with the steps below. +For supported frameworks and project types, Wrangler can [configure or deploy your project automatically](/workers/framework-guides/automatic-configuration/). From your project root, run: + + + +If Wrangler detects your project, confirm the generated settings. If Wrangler cannot detect your project or you need to adjust routing behavior, continue with the manual migration steps. + ## Find your build command and build directory To move your application to Cloudflare Workers, you will need to know your build command and build directory. Cloudflare Workers will use this information to build and deploy your application. We will cover how to find these values in the Netlify Dashboard below. diff --git a/src/content/docs/workers/static-assets/migration-guides/vercel-to-workers.mdx b/src/content/docs/workers/static-assets/migration-guides/vercel-to-workers.mdx index 54413a24985..46ce37f5475 100644 --- a/src/content/docs/workers/static-assets/migration-guides/vercel-to-workers.mdx +++ b/src/content/docs/workers/static-assets/migration-guides/vercel-to-workers.mdx @@ -9,7 +9,7 @@ products: - workers --- -import { WranglerConfig } from "~/components"; +import { PackageManagers, WranglerConfig } from "~/components"; In this tutorial, you will learn how to migrate your Vercel application to Cloudflare Workers. @@ -19,6 +19,12 @@ You should already have an existing project deployed on Vercel that you would li Some frameworks like Next.js, Astro with on demand rendering, and others have specific guides for migrating to Cloudflare Workers. Refer to our [framework guides](/workers/framework-guides/) for more information. If your framework has a **Deploy an existing project on Workers** guide, follow that guide for specific instructions. Otherwise, continue with the steps below. +For supported frameworks and project types, Wrangler can [configure or deploy your project automatically](/workers/framework-guides/automatic-configuration/). From your project root, run: + + + +If Wrangler detects your project, confirm the generated settings. If Wrangler cannot detect your project or you need to adjust routing behavior, continue with the manual migration steps. + ## Find your build command and build directory To move your application to Cloudflare Workers, you will need to know your build command and build directory. Cloudflare Workers will use this information to build and deploy your application. We'll cover how to find these values in the Vercel Dashboard below. diff --git a/src/content/docs/workers/tutorials/deploy-an-express-app.mdx b/src/content/docs/workers/tutorials/deploy-an-express-app.mdx index 63a565491ae..930787a3ae2 100644 --- a/src/content/docs/workers/tutorials/deploy-an-express-app.mdx +++ b/src/content/docs/workers/tutorials/deploy-an-express-app.mdx @@ -31,6 +31,18 @@ This creates a repository in your GitHub account and deploys the application to You may wish to manually follow the steps if you are new to Cloudflare Workers. +If you already have an Express.js app and do not need the D1 steps in this tutorial, Wrangler can generate the Workers wrapper and `nodejs_compat` configuration for you: + +"} +/> + +For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). + +If your existing app uses `express.static()` or Node HTTP upgrade/WebSocket patterns, review the generated configuration. Static assets and WebSocket routes may require manual migration. + ## 1. Create a new Cloudflare Workers project Use [C3](https://developers.cloudflare.com/learning-paths/workers/get-started/c3-and-wrangler/#c3), the command-line tool for Cloudflare's developer products, to create a new directory and initialize a new Worker project: diff --git a/src/content/docs/workers/vite-plugin/index.mdx b/src/content/docs/workers/vite-plugin/index.mdx index b2e15669d52..659000e0384 100644 --- a/src/content/docs/workers/vite-plugin/index.mdx +++ b/src/content/docs/workers/vite-plugin/index.mdx @@ -34,4 +34,6 @@ To create a new application from a ready-to-go template, refer to the [TanStack To create a standalone Worker from scratch, refer to [Get started](/workers/vite-plugin/get-started/). +If you already have a static Vite app and do not need the Cloudflare Vite plugin, Wrangler can deploy it with the experimental static assets auto-configuration flag. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). + For a more in-depth look at adapting an existing Vite project and an introduction to key concepts, refer to the [Tutorial](/workers/vite-plugin/tutorial/). diff --git a/src/content/docs/workers/vite-plugin/tutorial.mdx b/src/content/docs/workers/vite-plugin/tutorial.mdx index 9ae1ae30e6b..99e6a351782 100644 --- a/src/content/docs/workers/vite-plugin/tutorial.mdx +++ b/src/content/docs/workers/vite-plugin/tutorial.mdx @@ -18,6 +18,8 @@ Much of the content can also be applied to adapting existing Vite projects and t :::note If you want to start a new app with a template already set up with Vite, React and the Cloudflare Vite plugin, refer to the [React framework guide](/workers/framework-guides/web-apps/react/). To create a standalone Worker, refer to [Get started](/workers/vite-plugin/get-started/). + +If you only need to deploy an existing static Vite app, Wrangler can deploy it with the experimental static assets auto-configuration flag without adding the Cloudflare Vite plugin. For more information, refer to [Deploy an existing project](/workers/framework-guides/automatic-configuration/#deploy-a-specific-target). ::: ## Introduction @@ -205,6 +207,7 @@ This opts out of interpreting the `Sec-Fetch-Mode` header. ``` + ::: ### Call the API from the client diff --git a/src/content/docs/workers/wrangler/commands/workers.mdx b/src/content/docs/workers/wrangler/commands/workers.mdx index 02f0a284c3f..91976bfca06 100644 --- a/src/content/docs/workers/wrangler/commands/workers.mdx +++ b/src/content/docs/workers/wrangler/commands/workers.mdx @@ -154,7 +154,7 @@ None of the options for this command are required. Many of these options can be Deploy your Worker to Cloudflare. -When you run `wrangler deploy` in a project directory without a Wrangler configuration file, Wrangler will [automatically detect your framework](/workers/framework-guides/automatic-configuration/) and configure your project for Cloudflare Workers. This command will prompt you to confirm the detected settings before applying changes. Confirm that you would like to proceed, and your project will be configured and deployed. +When you run `wrangler deploy` in a project directory without a Wrangler configuration file, Wrangler can [automatically detect your framework, project type, or deploy target](/workers/framework-guides/automatic-configuration/). This command prompts you to confirm the detected settings before applying changes. Confirm that you would like to proceed, and Wrangler configures and deploys your project. To deploy from an AI agent or another environment before Cloudflare authentication is available, use `wrangler deploy --temporary`. This flow requires Wrangler 4.102.0 or later. Wrangler creates or reuses a temporary preview account, deploys to that account, and prints a claim URL. For more information, refer to [Claim deployments](/workers/platform/claim-deployments/). @@ -171,15 +171,12 @@ None of the options for this command are required. Also, many can be set in your ::: - `PATH` - - A path specific what needs to be deployed, this can either be: - - The path to an entry point for your Worker. - - Only required if your [Wrangler configuration file](/workers/wrangler/configuration/) does not include a `main` key (for example, `main = "index.js"`). - - - Or the path to an assets directory for the deployment of a static site. - - Visit [assets](/workers/static-assets/) for more information. - - This overrides the eventual `assets` configuration in your [Wrangler configuration file](/workers/wrangler/configuration/). - - This is equivalent to the `--assets` option listed below. - - Note: this option currently only works only in interactive mode (so not in CI systems). + - The path to what Wrangler should deploy. This can be a Worker entrypoint, an Express-style Node HTTP server entrypoint, an HTML file, an assets directory, a static Vite app directory, a Dockerfile, or a Containerfile. + - A Worker entrypoint is only required if your [Wrangler configuration file](/workers/wrangler/configuration/) does not include a `main` key, for example `main = "index.js"`. + - To deploy a configured static site, pass an assets directory. This overrides the `assets` configuration in your Wrangler configuration file and is equivalent to the `--assets` option. This option works only in interactive mode. + - To deploy an HTML file without creating a Wrangler configuration file, pass the `.html` file directly. + - To deploy an explicit static directory or static Vite app directory without creating a Wrangler configuration file, pass the directory with `--experimental-auto-config-static-assets`. + - To configure and deploy a Dockerfile-backed Container project, pass `Dockerfile` or `Containerfile` with `--experimental-auto-config-containers`. - `--name` - Name of the Worker. @@ -198,6 +195,10 @@ None of the options for this command are required. Also, many can be set in your - Use the latest version of the Workers runtime. - `--assets` - Folder of static assets to be served. Replaces [Workers Sites](/workers/configuration/sites/). Visit [assets](/workers/static-assets/) for more information. +- `--experimental-auto-config-static-assets` + - Deploy an explicit static assets directory or static Vite app directory without creating a Wrangler configuration file. Requires `PATH` to be a directory. +- `--experimental-auto-config-containers` + - Configure and deploy a Dockerfile-backed Containers project. Use with `wrangler deploy Dockerfile`, `wrangler deploy Containerfile`, or `wrangler setup`. In CI, pass an explicit Dockerfile or Containerfile target, or use `wrangler setup --yes --experimental-auto-config-containers`. - `--site` - Folder of static assets for Workers Sites. :::caution @@ -239,8 +240,8 @@ None of the options for this command are required. Also, many can be set in your - Specify the [Workers for Platforms dispatch namespace](/cloudflare-for-platforms/workers-for-platforms/how-workers-for-platforms-works/#dispatch-namespace) to upload this Worker to. - `--metafile` - Specify a file to write the build metadata from esbuild to. If flag is used without a path string, this defaults to `bundle-meta.json` inside the directory specified by `--outdir`. This can be useful for understanding the bundle size. -- `--containers-rollout` - - Specify the [rollout strategy](/containers/faq#how-do-container-updates-and-rollouts-work) for [Containers](/containers) associated with the Worker. If set to `immediate`, 100% of container instances will be updated in one rollout step, overriding any configuration in `rollout_step_percentage`. Note that `rollout_active_grace_period`, if configured, still applies. +- `--containers-rollout` + - Specify the [rollout strategy](/containers/platform-details/rollouts/) for [Containers](/containers/) associated with the Worker. If set to `immediate`, 100% of container instances will be updated in one rollout step, overriding any configuration in `rollout_step_percentage`. The `rollout_active_grace_period` setting still applies. If set to `none`, Wrangler deploys Worker changes without building or updating Containers. - Defaults to `gradual`, where the default rollout is 10% then 100% of instances. - `--strict` - Turns on strict mode for the deployment command, meaning that the command will be more defensive and prevent deployments which could introduce potential issues. In particular, this mode prevents deployments if the deployment would potentially override remote settings in non-interactive environments. @@ -282,6 +283,8 @@ wrangler delete [