Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`cf deploy` duplicates the build step when `--prebuilt` flag is not used

Abierto
#183 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
typescript, vite

Línea de trabajo

Start with the cf deploy and cf build command entry points and reproduce the behavior using the commands and Vite+ setup described in the issue. Compare how --prebuilt, existing .cloudflare/output/v0, and project build scripts are handled; done means the chosen behavior avoids an unintended duplicate build without breaking deployment.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

In Cloudflare's dashboard, "build" and "deploy" are two separate steps, and cf deploy builds automatically without setting --prebuilt. This is quite confusing when migrating from wrangler (e.g., a drop-in replacement of npx wrangler deploy with npx cf deploy) and causes several issues when the deploy command is set to pnpm|npx cf deploy:

  • It duplicates the build. cf runs its own build step again even when the build command was set and executed. Unnecessarily increases build time.
  • There is a risk of unexpected overwriting of object code when cf's chosen build script differs from the user's. This can be very difficult to debug in certain edge cases.
  • This behavior cannot be configured. Seems like cf detects the project layout and chooses the toolchain automatically. There is no config item to set a build script.
  • Specifically, for projects using Vite+, where vite was linked to npm:@voidzero-dev/[email protected] and the vite CLI was never installed, cf will attempt to invoke pnpm vite build and fail.
  • npx cf build works for Vite+, but at the cost of downloading Vite again via npx vite build. This also brings the risk of version disparity.

Possible solutions:

  • Add hints on unsetting the build script when using cf deploy.
  • Allow configuring the build script in cloudflare.config.ts, mirroring wrangler. This should also smooth migration from wrangler, although the targeted UX seems to be eliminating this option.
  • Maybe skip building automatically on deploy when .cloudflare/output/v0 exists. Of course, with a flag to enforce it, like --build.
  • Would appreciate it if cf could add support for Vite+.

Off topic: I love the new CLI, much beyond wrangler, and congrats to the team who shipped such a great tool!

Lenguaje dominante
TypeScript
Estrellas
853
Forks
42
Merge medio
17 h 59 min
PR fusionados (30 d)
145

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudflare/cf

Todos los issues de cloudflare/cf

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.