Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Caution
検証中のためマージはしないでください。
課題・背景
やったこと
@astrojs/cloudflare のインストールと有効化
smarthr-design-system/package.json
Lines 43 to 50 in cdb1731
@astrojs/cloudflare の最新バージョンに対応するため、Astro本体と一部ライブラリもアップデートしています。
smarthr-design-system/astro.config.mjs
Line 15 in cdb1731
Astro 5.xへの対応
参考: Upgrade to Astro v5
smarthr-design-system/tsconfig.json
Line 11 in 8444393
smarthr-design-system/astro.config.mjs
Line 14 in cdb1731
smarthr-design-system/src/lib/getNestedHeadings.ts
Line 1 in cdb1731
Cloudflare Pagesへの対応
smarthr-design-system/astro.config.mjs
Lines 50 to 72 in cdb1731
Node.jsの互換性のためのViteのバンドルから除外指定します。
Workersと異なりWranglerの設定は不要です。
ファイルサイズ上限への対処
25MBの上限がありWorkersのように除外設定ができないため、以下の静的アセットを削除しています。
デプロイ時間にも影響するため、別途ストレージサービスに設置するなどの運用が良いかもしれません。
重複しているリダイレクト設定を削除
ビルドエラーになるため上記2箇所を削除、実際に有効になっている方を残しています。
検証中のため暫定的なのもの(11/13時点)
feat/cloudflare-pagesのみ自動デプロイが有効ですnpm run buildを使用しています