False positive unused file for Vercel vercel.ts config What happened? fallow dead-code…
- User
False positive unused file for Vercel vercel.ts config
What happened?
fallow dead-codereportsapps/web/vercel.tsas an unused file, but Vercel treatsvercel.tsas a project configuration file that is discovered and executed by convention.The file is not imported by application source, so it looks unused to a pure import graph. It should be treated as a Vercel config entrypoint.
Vercel docs say:
vercel.tsconfigures and overrides Vercel project behavior.- Unlike
vercel.json,vercel.tsexecutes at build time. - The final config must be exported as
config. - Vercel also supports
vercel.js,vercel.mjs,vercel.cjs, andvercel.mts.
The
@vercel/configpackage also treatsvercel.tsas the config input:packages/config/README.mdsays to create avercel.tsfile in the project root.packages/config/README.mdsaysvercel.tsis automatically compiled duringvercel build,vercel dev, andvercel deploy.packages/config/src/cli.tsresolvesprocess.cwd()/vercel.ts.packages/config/src/cli.tsimports the config module and collects named exports.- shows the expected shape.
- Assistant
I'll find how Fallow handles Vercel and other framework config entrypoints, then add the programmatic Vercel config files to the always-used patterns.
- Assistant
Implementing a Vercel plugin modeled on the Danger and OpenNext Cloudflare plugins.
- Assistant
Fixed by adding a dedicated Vercel deployment plugin that treats programmatic Vercel config files as support entry points.
What changed
New plugin at
crates/core/src/plugins/vercel.rs:- Activates when a project has
vercelor@vercel/configin dependencies, runsvercelinpackage.jsonscripts, or has a discoveredvercel.{ts,js,mjs,cjs,mts}file - Marks as always used (root and nested, for monorepos):
vercel.tsvercel.jsvercel.mjsvercel.cjsvercel.mts
- Credits imports from those config files (e.g.
@vercel/config) viaresolve_config
This follows the same pattern as the Wrangler and OpenNext Cloudflare plugins: convention-discovered config that Vercel executes at build time, not application imports.
Tests added
- Unit tests for plugin activation and config resolution
- Registry tests for dependency/script-based detection
- Integration test reproducing your
apps/web/vercel.tsmonorepo scenario
- Activates when a project has
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.