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

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

オープン 初心者向け
#8,512 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
build-system

調査の方向性

src/build-sitemap.ts から開始し、new Date() が sitemap.xml と pages.json に書き込まれている 2 か所を追跡します。SOURCE_DATE_EPOCH を設定して最小のビルド再現手順を実行し、その後、ビルドを繰り返すと sitemap.xml と pages.json がバイト単位で同一になることを確認します。一方、変数なしのビルドでは現在の動作が維持されることを確認します。

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

説明

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.

主要言語
TypeScript
スター
15.1k
フォーク
1.9k
平均マージ
2日 3時間
マージ済み PR(30日)
132

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

TanStack/router のほかの issue

TanStack/router の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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