Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 37 ยท Getting Started

Static Sites, Frameworks and Presets

See how Vercel and Netlify detect frameworks, which build command and output folder each one uses, and how static, SSR and hybrid sites are deployed differently.

When you import a repository, the platform looks inside it and guesses what you are building. That guess decides the build command, the output folder and whether functions are needed. Knowing how the guess works lets you fix it when it is wrong.

In this lesson you will learn the common frameworks and their defaults, the three rendering styles, and how to override the detection.

How detection works

Both platforms read your package.json (and sometimes other files such as astro.config.mjs or hugo.toml) and match known frameworks by their dependencies. A match sets a preset: a bundle of default build command, output directory and runtime adapters.

Framework Typical build command Output directory
Plain HTML none the repository root
Vite (React, Vue, Svelte) npm run build dist
Create React App (legacy) npm run build build
Astro npm run build dist
Next.js next build .next (handled by the platform)
Eleventy npx @11ty/eleventy _site
Hugo hugo public
Jekyll jekyll build _site

These defaults are conventions of each tool, not of the hosting platform. If your project customizes its output folder, you must tell the platform.

Node.js Framework detector (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Order matters in a real detector: Next.js projects also list react, and many frameworks use Vite internally, so more specific frameworks are checked first. That is why next appears before vite above.

Three rendering styles

Every page of a site is rendered in one of three ways, and many frameworks let you mix them per page.

Three ways to render

Static (SSG) Built once, served from the CDN.
Server (SSR) A function builds each response.
Hybrid (ISR) Static, refreshed in the background.

Pick per page, not per site.

1 / 2

Static sites produce only files, so the deployment is just a folder on the CDN. SSR adds functions that run on each request, which means usage-based limits apply and responses can be slower on a cold start. Hybrid approaches cache a rendered page and rebuild it after a time or when you trigger it.

Adapters: how a framework reaches a platform

A framework such as Astro, SvelteKit or Nuxt that does server rendering must be told where it will run. It uses an adapter (or a preset) that packages server code in the format the platform expects. For example, in an Astro project you would install the adapter for your platform and name it in the config:

JavaScript
// astro.config.mjs (read-only example)
import { defineConfig } from "astro/config";
import netlify from "@astrojs/netlify";

export default defineConfig({
  output: "server",       // render on request
  adapter: netlify(),     // package server code for Netlify Functions
});

On Vercel you would use the matching Vercel adapter instead. Pure static output (output: "static") needs no adapter at all, because plain files run anywhere. Check your framework's current deployment guide for the exact adapter name and version, since these change.

Overriding the guess

If detection is wrong, set the values yourself:

  • Vercel: Project Settings > Build and Deployment has Framework Preset, Build Command, Output Directory and Install Command fields with an Override switch. Or put them in vercel.json (buildCommand, outputDirectory, installCommand, framework).
  • Netlify: Site configuration > Build & deploy > Build settings, or put command and publish in [build] inside netlify.toml.
TOML
# netlify.toml
[build]
  command = "npm run build"
  publish = "dist"
JSON
{
  "buildCommand": "npm run build",
  "outputDirectory": "dist"
}

The second block is vercel.json. Settings written in a file in your repository win over a stale dashboard guess, which is one more reason to commit them.

Debugging an empty site

If the deploy succeeds but the site is blank or 404, check in order:

  1. Did the build command actually run (look at the build log)?
  2. Does the output directory exist after the build and contain index.html?
  3. Is a single-page app missing a fallback rule so deep links 404? (You will learn rewrites in the redirects chapter.)
Node.js Output folder checker (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a framework preset provide?

    A preset is a bundle of defaults chosen after the platform recognizes your framework.
  2. 2. Which output directory does a default Vite build use?

    Vite writes its production build to dist unless configured otherwise.
  3. 3. Which rendering style builds pages once and serves them straight from the CDN?

    Static generation produces files at build time, so no function runs per request.
  4. 4. Why does a server-rendering framework need an adapter?

    Adapters translate the framework's server output into platform functions.

Summary

  • Platforms detect frameworks from package.json and apply presets for build command and output directory.
  • Static, SSR and hybrid rendering have different cost and speed trade-offs, and you can mix them per page.
  • Server rendering needs an adapter for the target platform.
  • Override wrong guesses in the dashboard or, better, in vercel.json / netlify.toml.
  • An empty site usually means a wrong output directory or a build that never ran.

Next: Command Line Basics