`cf deploy` / `cf build` need a package.json in the Worker directory that declares `@cloudflare/vite-plugin`

Đang mở
#60 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript, vite
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

Start by tracing implementation discovery used by cf build and cf deploy, especially the manifest check in the Worker's directory. Reproduce the Bun workspace case with the documented cf deploy --dry-run or cf build command, then verify that discovery reaches the workspace root or accepts an explicit root or manifest path. Done means both commands work without a Worker-local package.json.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

In a Bun workspace, a Worker whose cloudflare.config.ts and vite.config.ts sit in a subdirectory with no package.json of its own cannot be built or deployed with a bare cf deploy / cf build. The Vite plugin is installed at the workspace root. cf looks for a manifest only in the Worker's own directory:

$ cd packages/api/src/register && cf deploy --dry-run --mode staging
…
The manifest checked was: …/packages/api/src/register/(package.json|pyproject.toml|Cargo.toml)

The workaround is vite build --mode <m> in that directory, then cf deploy --prebuilt --mode <m>, which works.

Expected

Implementation discovery resolves @cloudflare/vite-plugin the way Node resolution does, walking up to the workspace root, or accepts an explicit --root / manifest path.

Environment

[email protected], @cloudflare/[email protected], Bun workspaces, macOS.

Ngôn ngữ chính
TypeScript
Star
993
Fork
65
Merge trung bình
21 giờ 47 phút
Pull request đã merge (30 ngày)
209

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudflare/cf

Tất cả issue của cloudflare/cf

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.