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 files as used and where the Vercel plugin is defined so we can add
vercel.tsand related variants. - Assistant
Implementing a Vercel plugin modeled on the OpenNext Cloudflare and pkg-utils plugins, then adding tests.
- Assistant
Running the new Vercel plugin and integration tests.
- Assistant
All tests passed. Running clippy on the changed files.
- Assistant
Added a Vercel deployment plugin so programmatic Vercel config files are treated as framework entrypoints instead of unused files.
What changed
New plugin:
crates/core/src/plugins/vercel.rsActivates when any of these are present:
vercelor@vercel/configin dependenciesvercelinvoked frompackage.jsonscripts (e.g.vercel env pull)
When active, these files are always considered used (root and nested workspace packages):
vercel.tsvercel.jsvercel.mjsvercel.cjsvercel.mts
The plugin also parses
vercel.*config files for imports, so dependencies like@vercel/configare not flagged as unused.This follows the same pattern as the OpenNext Cloudflare and Wrangler plugins: convention-based config files that Vercel discovers and executes at build time are credited as support entrypoints even when application source never imports them.
Tests
- Unit tests for plugin activation, patterns, and import resolution
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.