Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

start-plugin-core: sitemap lastmod and pages.json lastBuilt are stamped with the build's wall clock (no SOURCE_DATE_EPOCH support)

Đang mở Phù hợp với người mới
#8,512 0 bình luận 0 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu trong src/build-sitemap.ts và lần theo hai vị trí nơi new Date() được ghi vào sitemap.xml và pages.json. Chạy bản tái hiện build tối thiểu với SOURCE_DATE_EPOCH được thiết lập, sau đó xác minh rằng các build lặp lại tạo ra sitemap.xml và pages.json giống hệt nhau từng byte, trong khi các build không có biến này vẫn giữ nguyên hành vi hiện tại.

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

Mô tả

Which project does this relate to?

Start

Describe the bug

@tanstack/start-plugin-core's sitemap builder (src/build-sitemap.ts) writes new Date() into two places on every build:

  • <lastmod> of every sitemap entry whose route declares no sitemap.lastmod — which is every page discovered by crawlLinks, since crawled pages have no per-page config to set one on;
  • lastBuilt in pages.json.

So building the same sources twice on different days yields different output. That breaks any deploy pipeline that hashes the client dist to decide whether prod is current (ours: a Bazel build whose dist hash is compared against the last deploy; a lint-tool dependency bump re-ran the vite action and every page's lastmod moved to that day, reporting the site as changed when nothing user-visible had). It also makes the sitemap's lastmod meaningless to crawlers: Google documents that it uses lastmod only when it is "consistently and verifiably accurate", and a build date tells them every page changed on every rebuild.

There is no configuration escape hatch: the top-level sitemap options are enabled, host, outputPath only, and the default cannot be reached for crawled pages.

The reproducible-builds convention for exactly this is the SOURCE_DATE_EPOCH environment variable (https://reproducible-builds.org/specs/source-date-epoch/), which build tools consult in place of "now" for embedded timestamps. The plugin does not read it.

Complete minimal reproducer

Any Start app with prerendering, link crawling and sitemap.host set (the SEO guide's example config):

pnpm build && cp dist/client/sitemap.xml /tmp/a.xml
# next day, or with a faked clock:
faketime '+1d' pnpm build && cp dist/client/sitemap.xml /tmp/b.xml
diff /tmp/a.xml /tmp/b.xml   # every <lastmod> differs; sources unchanged

Expected: with SOURCE_DATE_EPOCH=1700000000 exported, both builds produce byte-identical sitemap.xml and pages.json. Without it, current behavior is fine to keep.

PR to follow.

Ngôn ngữ chính
TypeScript
Star
15.1k
Fork
1.9k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
132

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 TanStack/router

Tất cả issue của TanStack/router

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.