fix: exclude build artifacts to prevent 250MB limit errors in monorepos#592
Open
daviddaytw wants to merge 1 commit intovercel-community:masterfrom
Open
fix: exclude build artifacts to prevent 250MB limit errors in monorepos#592daviddaytw wants to merge 1 commit intovercel-community:masterfrom
daviddaytw wants to merge 1 commit intovercel-community:masterfrom
Conversation
f3l1x
reviewed
Oct 23, 2025
| // Build outputs and caches | ||
| '.next/**', | ||
| '.turbo/**', | ||
| 'dist/**', |
Member
There was a problem hiding this comment.
I agree with all of them, but dist can be useful. If you need some resources for PHP, for example geoip.json, I think you can place it to data or dist or something like that. Ignoring dist folder can be hidden problem. WDYT?
If someone want to ignore it, you can use excludeFiles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When using
vercel-phpin modern monorepo setups (Turbo, Next.js, Nuxt, SvelteKit, etc.), deployments fail with:Root Cause
The PHP runtime bundles all files from
workPathinto each serverless function, excluding only:node_modules/**Modern frameworks generate large build artifacts (
.next/,.turbo/, etc.) that weren't common when this runtime was created. These directories get included in every PHP function, causing massive bundle sizes.Real-World Example
In a Turbo monorepo with Next.js:
.next/folder: 662 MB (mostly webpack cache)Solution
Update the default
excludeFileslist to exclude common modern build directories:.next/**- Next.js build output.turbo/**- Turbo cachedist/**- Common build output.cache/**- General build caches.nuxt/**- Nuxt.js build.svelte-kit/**- SvelteKit build.output/**- Nitro/Nuxt outputAdditional Context
This issue became prominent with the rise of: