Specific frameworks first
A meta-framework ships the tool it wraps. Test the narrow name first.
From deploy-to-vercel, script resources/deploy.sh.
First match wins
Pick an app, then press Detect.
Broad names firstBad
vite, next, … then
@remix-run/Specific names firstGood
blitz, next, remix, … vite last
# Order matters - check more specific frameworks first
if has_dep_exact "blitz"; then echo "blitzjs"; return; fi
if has_dep_exact "next"; then echo "nextjs"; return; fi
if has_dep_prefix "@remix-run/"; then echo "remix"; return; fi
if has_dep_exact "astro"; then echo "astro"; return; fi
# …
# Vite (generic - check last among JS frameworks)
if has_dep_exact "vite"; then echo "vite"; return; fi
Why it matters, pros and cons
Why it matters
Blitz depends on next and Remix on vite. A first-match scan that tries the broad name first picks the wrong preset.
Pros
- The right build preset without asking.
- One ordered list, easy to extend.
- Plain apps still fall through to vite.
Cons
- Reads only the root
package.json. - A wrong guess needs
vercel.jsonto fix. - A tarball can't be scanned: no preset.