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:
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.
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
.
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.
Examples where the Vite configuration should be used instead include alias
and define
.
See Vite Environments for more information about configuring your Worker environments in Vite.
The Vite plugin does not support remote mode. We will be adding support for accessing remote resources in local development in a future update.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark