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 marks framework config entrypoints as used and extend that for Vercel's programmatic config files.
- Assistant
Implementing the Vercel plugin and registering it in the plugin system.
- Assistant
Added a Vercel deployment plugin so programmatic Vercel config files are treated as config entrypoints instead of unused files.
What changed
New plugin at
crates/core/src/plugins/vercel.rsthat activates when:vercelor@vercel/configis in dependencies/devDependencies- A
vercelCLI script is present (e.g.vercel env pull) - A root-level
vercel.ts/vercel.js/vercel.mjs/vercel.cjs/vercel.mts/vercel.jsonexists
When active, these files are marked always-used (including workspace paths like
apps/web/vercel.ts):vercel.{ts,js,mjs,cjs,mts}vercel.json
The plugin also:
- Credits
verceland@vercel/configas tooling dependencies - Credits imports from programmatic config files (e.g.
@vercel/config/v1) - Marks the
confignamed export as framework-used when--include-entry-exportsis on
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.