Part 01 / Topic 2 of 8
Scaffolding a project with Vite
Vite (French for "fast," pronounced "veet") is the build tool this course uses to turn your source files into something a browser can run, with a dev server that updates the page as you save. npm create vite@latest is the official way to start a new project; --template react picks the plain-JavaScript React template (not react-ts - see the root DESIGN-NOTES.md for why TypeScript is deferred in this course).
Real-world example: scaffolding a project called my-first-react-app, verified on this machine (Node 22.23.2, npm 11.17.0 - see TOOLING.md):
$ npm create vite@latest my-first-react-app -- --template react
create-vite v9.4.0
│ Scaffolding project in .../my-first-react-app...
└ Done. Now run:
cd my-first-react-app
npm install
npm run dev
$ cd my-first-react-app
$ npm install
added 24 packages, and audited 25 packages in 7s
found 0 vulnerabilities
$ npm run build
> vite build
vite v8.4.0 building client environment for production...
✓ 20 modules transformed.
✓ built in 538ms
Two things worth noticing: --template react skips every interactive prompt, so this command never waits for you to answer a question; and npm run build is a real compile step the moment the project exists, not something that only matters once you have written code. npm run dev (not run above, to avoid leaving a server running) starts the dev server you will actually work against; it prints a http://localhost:5173/ URL to open.
Done here? The practice set for Part 1 — including the solutions — is on the part page.