This is a TinaCMS starter project for Vite + React.
Install dependencies and start the dev server (Tina + Vite):
Note
Do you know the best package manager for Node.js? Using the right package manager can greatly enhance your development workflow. We recommend using pnpm for its speed and efficient handling of dependencies. Learn more about why pnpm might be the best choice for your projects by checking out this rule from SSW.
pnpm install
pnpm dev
Copy .env.example to .env, fill in your values from app.tina.io, then:
pnpm build
No credentials yet? pnpm build-local builds against local content.
This is a client-side SPA — pnpm build produces one dist/index.html plus assets, and react-router decides routes in the browser. A host that only serves matching files will 404 on a direct hit or refresh of any route but /, so a rewrite/fallback to index.html is required:
- Vercel —
vercel.json(included) rewrites every path to/index.html. - Cloudflare Workers —
wrangler.jsonc(included) setsassets.not_found_handling: "single-page-application", which does the same thing. Deploy withnpx wrangler deployafterpnpm build.