Skip to content

Stop shipping six copies of static/ in every deployment - #180

Merged
YurMil merged 1 commit into
mainfrom
fix/vercel-deployment-size
Sep 18, 2026
Merged

YurMil merged 1 commit into
mainfrom
fix/vercel-deployment-size

Conversation

@YurMil

@YurMil YurMil commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Why

Vercel Hobby shows Deployment Storage 71 GB / 10 GB. Docusaurus copies static/ into every locale build (build/ru, build/ua, …), so each deployment carried the ~340 MB of utility apps six times: ~2.1 GB per deployment. Every push to any branch (including Dependabot) creates one, and retained deployments add up.

What

  • scripts/dedupe-locale-static.js (runs in postbuild): deletes the locale copies of static files. Local build: 2.1 GB → 436 MB. It fails the build if a new top-level static/ entry is not covered by the rewrite.
  • vercel.json rewrite: /<locale>/{utility-apps,mini-games,img,vendor,…}/… → root copy. Vercel rewrites only apply when no file matches, so generated locale pages (e.g. /ru/mini-games/) are still served from the locale build. Headers match on the request path, so they don't change.
  • vercel.json: git.deploymentEnabled off for dependabot/** branches.

Still needs a manual step

This only makes new deployments smaller. Old deployments keep counting until they are removed: set a Deployment Retention Policy in Project Settings, and/or delete old preview deployments.

🤖 Generated with Claude Code

Docusaurus copies static/ into each locale build, so every deployment
carried the ~340 MB of utility apps six times (~2.1 GB). With dozens of
retained preview and production deployments this put Deployment Storage
at 71 GB on a 10 GB Hobby quota.

- postbuild: drop the locale copies of static files (build now ~440 MB).
- vercel.json: rewrite /<locale>/<static dir>/... to the root copy; rewrites
  only apply when no file matches, so generated locale pages still win.
- vercel.json: skip Vercel deployments for Dependabot branches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cadautoscript-com Ready Ready Preview Sep 18, 2026 2:49pm UTC

@supabase

supabase Bot commented Sep 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project bkcimygtsnckzexbfqxh because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T14:53:58.246475Z 2ff321a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ff321a115

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dedupe-locale-static.js
@YurMil
YurMil merged commit 6e2dea9 into main Sep 18, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2ff321a1 Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant