Skip to content
Cloudflare Docs

Migrating from wrangler dev

In most cases, migrating from wrangler dev is straightforward and you can follow the instructions in Get started. There are a few key differences to highlight:

Input and output Worker config files

With the Cloudflare Vite plugin, your Worker config file (for example, wrangler.jsonc) is the input configuration and a separate output configuration is created as part of the build. This output file is a snapshot of your configuration at the time of the build and is modified to reference your build artifacts. It is the configuration that is used for preview and deployment. Once you have run vite build, running wrangler deploy or vite preview will automatically locate this output configuration file.

Cloudflare Environments

With the Cloudflare Vite plugin, Cloudflare Environments are applied at dev and build time. Running wrangler deploy --env some-env is therefore not applicable and the environment to deploy should instead be set by running CLOUDFLARE_ENV=some-env vite build.

Redundant fields in the Wrangler config file

There are various options in the Worker config file that are ignored when using Vite, as they are either no longer applicable or are replaced by Vite equivalents. If these options are provided, then warnings will be printed to the console with suggestions for how to proceed.

Not applicable

The following build-related options are handled by Vite and are not applicable when using the Cloudflare Vite plugin:

  • tsconfig
  • rules
  • build
  • no_bundle
  • find_additional_modules
  • base_dir
  • preserve_file_names

Not supported

Replaced by Vite equivalents

The following options have Vite equivalents that should be used instead:

Wrangler optionVite equivalent
definedefine
aliasresolve.alias
minifybuild.minify
Local dev settings (ip, port, local_protocol, etc.)Server options

See Vite Environments for more information about configuring your Worker environments in Vite.