Publish a deck on Vercel
Goal: add a vercel.json configuration to a Markdown deck, run and inspect the exact static
build locally, and publish it on Vercel from Git or with the Vercel CLI.
The starting files for this guide live in examples/ (slides.md and package.json).
For the full deployment reference — including sites built on @recit/site, PDF exports on Vercel,
and custom domains — see Deploy on Vercel.
1. Start from the deck
Start in a project folder that holds slides.md and package.json with recit installed, such as
examples/ (or a folder created by following
Write and present your first deck):
slides.mddefines three Markdown slides (Lorem Ipsum,Sed do eiusmod, and a quotation);package.jsonlistsrecitindependenciesand defines"build":, so"recit build slides.md" recit build slides.mdalready compiles the deck locally.
Make sure your package manager lockfile (pnpm-) is present at the root of the project so
Vercel installs the exact same dependency tree. This guide uses pnpm; a project created with npm, as
in the first-deck guide, keeps its package- and writes "installCommand":
and "buildCommand": in the next step.
2. Add vercel.json at the root
Create vercel.json next to package.json and slides.md:
vercel.json
"$schema"points your editor to Vercel's JSON Schema so keys and values are validated as you edit."framework":stops Vercel from guessing a framework and overriding the commands in this file.null "installCommand"runspnpm installto installrecitand the project's dependencies before building."buildCommand"runs the project'srecitCLI to compileslides.mdinto thedistdirectory (-o, --).output <dir> "outputDirectory"tells Vercel to serve the generateddistfolder as static files.
If you later deploy a full site built on @recit/site instead of a standalone deck, set
"outputDirectory": so Vercel reads the build's .vercel/ directory (see
Deploy on Vercel).
3. Run the build on your machine
Before deploying, run the exact buildCommand from vercel.json on your machine:
Bash
recit build compiles the story in strict mode by default (exiting non-zero on blocking density or
data diagnostics unless --no-strict is passed) and writes a self-contained static folder in
dist/:
dist/— the entry HTML page of the deck;index.html dist/assets/— the compiledmain.jsandmain.cssbundles, theme fonts, and any local media referenced by the slides.
What recit build writes is purely static and needs no Node.js server at runtime. Check dist/
locally with any static file server:
Bash
Open the local address in your browser: the first slide (Lorem Ipsum) is displayed, ArrowRight
moves to slide 2 (Sed do eiusmod), and every file under /assets/ loads without error. Stop the
local server (Ctrl+C) once verified.
4. Deploy to Vercel
You can publish the deck either by connecting a Git repository or directly from your terminal with the Vercel CLI.
Option A: From Git
- Push the project (
slides.md,package.json,pnpm-, andlock.yaml vercel.json) to GitHub, GitLab, or Bitbucket. - Open vercel.com/new and import the repository (in a monorepo, set Root Directory to the deck's folder).
- Leave Framework Preset on "Other" — Vercel reads the install, build, and output settings from
vercel.json. - Click Deploy. Pushes to your production branch update the production URL, while other branches and pull requests receive preview URLs.
Option B: With the Vercel CLI
From the deck's folder, sign in and link the project once, then deploy a preview URL first and
publish to production with --prod:
Bash
vercel deploy (and vercel deploy --) uploads the project sources and lets Vercel run the
commands in vercel.json. To build on your machine and upload that prebuilt output instead, run
vercel pull --, vercel build, and vercel deploy -- (adding
--environment= and --prod for production; see
From your machine).
Add .vercel to .gitignore so the local project link and build output are not committed.
5. Optional: security headers
A standalone deck is served from dist/ as plain static files, so its HTTP headers go in a
headers array of vercel.json, as for any static project on Vercel. The security keys of
recit. (preset, headers, csp) belong to the Récit site framework: recit build
does not write them for a deck. When you publish decks inside a Récit site (which writes
.vercel/ and makes Vercel ignore the headers of vercel.json), declare them under
security instead — see
Security headers.
Check
- Running
pnpm exec recit build slides.exits withmd - o dist 0and writesdist/andindex.html dist/assets/. - Opening the deployed Vercel URL displays the first slide (
Lorem Ipsum). - Pressing
ArrowRight(→) advances to slide 2 (Sed do eiusmod), andArrowLeft(←) returns to slide 1. - Requests to
/assets/…(main.css,main.js, fonts, and media) load with status200and no404responses.
See also
- Deploy on Vercel — full reference for
vercel.json,.vercel/onoutput @recit/site, security headers, PDF exports on Vercel, and custom domains. - Write and present your first deck — create
slides.mdfromexamples/, preview withdeck- starter recit dev, and builddist/. - Add a theme and its colors — apply a named theme or a
tokens.jsonpalette to the deck before publishing. - Exporting — export the same
slides.mdto a standalone HTML file, a PDF, slide images, or PowerPoint. - CLI reference — options for
recit build, including-o, --output,--base, and--no-strict.