Cloudflare Workers Builds
When you connect a Git repository to Cloudflare Workers Builds, you can use your project's copy of vp for both the build and deploy commands. Cloudflare does not list a global vp in its build image.
Configure the build and deploy commands
Add
vite-plusas a development dependency and commit your lockfile. Leave automatic dependency installation enabled so Workers Builds installsvpinnode_modules/.binbefore the build starts. This works with any package manager configured to usenode_modules.Use the
buildanddeployscripts in yourpackage.json. Keep any framework-specific steps your project already uses. For example, a Worker that builds with Vite and deploys with Wrangler can use the following scripts.json{ "scripts": { "build": "vp build", "deploy": "wrangler deploy" } }This example uses
wranglerfrom the project's development dependencies. For help configuring Vite for your Worker, see Vite+ on Workers.In the Cloudflare dashboard, open your Worker and enter the following commands under Settings > Build.
Setting Value Build command ./node_modules/.bin/vp run buildDeploy command ./node_modules/.bin/vp run deploy
Both paths are relative to the Root directory in your build settings. If a monorepo installs vite-plus at the workspace root, adjust the path to its node_modules/.bin/vp in both fields. The run subcommand executes the named project script.
Install dependencies with vp install
If you want vp to install dependencies, set SKIP_DEPENDENCY_INSTALL to 1 under Settings > Build > Build Variables and Secrets. This skips Cloudflare's automatic install. Set Build command to bash scripts/workers-build.sh and commit the following script.
set -euo pipefail
export VP_HOME="$HOME/.vite-plus"
export PATH="$VP_HOME/bin:$PATH"
curl -fsSL https://codex-workers-builds-guide-viteplus-dev.voidzero-docs.workers.dev/install.sh | bash
vp install --frozen-lockfile
vp run buildKeep Deploy command set to ./node_modules/.bin/vp run deploy. The install step makes the project-local CLI available to the deploy command. To pin the CLI used for installation, set the VP_VERSION build variable to an exact release.