diff --git a/src/content/docs/cf/ci.mdx b/src/content/docs/cf/ci.mdx index 59b45cd62fa..7dafae318a2 100644 --- a/src/content/docs/cf/ci.mdx +++ b/src/content/docs/cf/ci.mdx @@ -58,7 +58,7 @@ pushes to `main`. - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: 22 + node-version: 24 cache: npm - run: npm ci - run: npx cf build @@ -123,7 +123,7 @@ each command to the project's copy. Collaborators, coding agents, and CI then run the same version. One-off runs such as `npx cf@` are not handed off. -Use Node.js 22.18 or later. For details, refer to +Use a supported Node.js release, such as Node.js 24.22 or later in Node.js 24. For details, refer to [Requirements](/cf/get-started/#requirements). ## Understand non-interactive behavior diff --git a/src/content/docs/cf/get-started/first-worker.mdx b/src/content/docs/cf/get-started/first-worker.mdx index 50d2506b363..fb4feaa3f04 100644 --- a/src/content/docs/cf/get-started/first-worker.mdx +++ b/src/content/docs/cf/get-started/first-worker.mdx @@ -48,21 +48,27 @@ these files: - index.d.ts - src/ - index.ts + - test/ + - index.test.ts - .gitignore - cloudflare.config.ts - package.json - tsconfig.json - vite.config.ts + - vitest.config.ts - `src/index.ts` is the Worker. - `cloudflare.config.ts` describes the Worker in TypeScript. -- `vite.config.ts` adds the [Cloudflare Vite plugin](/workers/vite-plugin/), +- `vite.config.ts` configures [Vite+](https://viteplus.dev) checks and adds the [Cloudflare Vite plugin](/workers/vite-plugin/), which runs your code in the Workers runtime during development and builds it for deployment. - `package.json` has `dev`, `build`, and `deploy` scripts that run the matching `cf` commands. It lists `cf` and the Vite plugin 2.0 beta (`@cloudflare/vite-plugin@beta`), which `cf` uses, but not Wrangler. + It also installs Vite+ locally for checks, formatting, and tests. +- `vitest.config.ts` configures tests to run in the Workers runtime. + `test/index.test.ts` checks the Worker response using its `WORLD` binding. - `.cloudflare/types/index.d.ts` holds generated binding and runtime types. The Vite plugin updates it when you run `cf dev` or `cf build`. The generated `.gitignore` excludes `.cloudflare/`. diff --git a/src/content/docs/cf/get-started/index.mdx b/src/content/docs/cf/get-started/index.mdx index 76e81136791..62793a1ec46 100644 --- a/src/content/docs/cf/get-started/index.mdx +++ b/src/content/docs/cf/get-started/index.mdx @@ -21,7 +21,7 @@ chooses credentials, accounts, and zones. - A Cloudflare account. If you do not have one, [sign up](https://dash.cloudflare.com/sign-up). -- Node.js 22.18 or later. Bun is not supported. When `cf` runs on Bun, commands +- Node.js 22.23+, 24.22+, or 26.12+. Bun is not supported. When `cf` runs on Bun, commands that load `cloudflare.config.ts` fail. ## Install `cf` diff --git a/src/content/docs/workers/vite-plugin/get-started.mdx b/src/content/docs/workers/vite-plugin/get-started.mdx index f4bdc5c7ede..4babc8d7b8a 100644 --- a/src/content/docs/workers/vite-plugin/get-started.mdx +++ b/src/content/docs/workers/vite-plugin/get-started.mdx @@ -97,3 +97,19 @@ A request to this Worker will return **'Running in Cloudflare-Workers!'**, demon ## Dev, build, preview and deploy You can now start the Vite development server (`npm run dev`), build the application (`npm run build`), preview the built application (`npm run preview`), and deploy to Cloudflare (`npm run deploy`). + +## Use Vite+ + +[Vite+](https://viteplus.dev) combines Vite with formatting, linting, type +checking, and testing. The Cloudflare Vite plugin also works with Vite+. + +For an existing project, follow the [Vite+ migration guide](https://viteplus.dev/guide/migrate). +Keep the Vite alias and Vitest override aligned with your Vite+ release. +Use `defineConfig` from `vite-plus` in your Vite configuration. + +Keep your framework's scripts and Cloudflare deployment command. For example, +`vp run build` runs a project's `build` script, while `vp build` runs Vite +without additional steps from that script. Adopting Vite+ does not require +converting a Wrangler configuration to `cloudflare.config.ts`. + +For a new project with `cf`, follow [Deploy your first Worker](/cf/get-started/first-worker/).