Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#183 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
typescript, vite

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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!

主要言語
TypeScript
スター
916
フォーク
53
平均マージ
18時間 42分
マージ済み PR(30日)
199

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudflare/cf のほかの issue

cloudflare/cf の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。