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 trace the existing Vercel plugin and its fixture/test conventions, then add the config entrypoint patterns and a regression test.
- Assistant
There isn’t currently a Vercel deployment plugin in this checkout, so the fix needs a small dedicated plugin rather than attaching Vercel’s convention to Next.js. I’m checking activation semantics now so it works for both the
vercelCLI and@vercel/configwithout becoming a global filename exemption. - Assistant
The implementation is in place: activation is scoped to Vercel dependencies/scripts, all five documented filenames are covered, and config imports are credited. I’ve also added an end-to-end CLI regression using the reported
vercel.tsshape; next I’m formatting and running focused tests. - Assistant
The focused regression passed. I tightened the contract to also recognize Vercel’s required named
configexport (including when entry-export checking is enabled) and made the extension test exercise each supported filename rather than only checking the pattern literal. - Assistant
The workspace-form reproduction now passes too:
apps/web/vercel.tsis protected by the workspace-scoped Vercel plugin, while the root package itself has no Vercel dependency. I’m doing the final registry and diff checks now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.