โšก Tools

Start Every Project with Vite โ€” Setup to Deploy in 10 Minutes

๐Ÿ“… Jul 5, 2026 โฑ 3 min read

Vite is the modern default: instant dev server, hot reload, optimized builds โ€” zero configuration for 95% of projects.

Zero to running

npm create vite@latest my-app
# pick: Vanilla / React / Vue + JS / TS
cd my-app && npm install && npm run dev
# โ†’ http://localhost:5173 with hot reload

What you get

Env variables (the gotcha)

# .env โ€” must be prefixed to reach the browser!
VITE_API_URL=https://api.example.com
SECRET_KEY=xxx                    # โ† NOT exposed (good!)

// in code:
fetch(import.meta.env.VITE_API_URL + "/students");

The prefix rule exists so you can't accidentally ship server secrets to the client โ€” anything without VITE_ stays private.

Ship it

npm run build      # โ†’ dist/ folder: minified, hashed, tree-shaken
npm run preview    # test the production build locally

Drag dist/ to Netlify or connect the repo to Vercel (they auto-detect Vite) โ€” see the hosting guide. Interview line: "Vite serves native ES modules in dev (instant) and bundles with Rollup for production" โ€” that's the whole architecture.

โ† All Articles