Commands
Pick your package manager. Commands change for each one.
Start Dev Server
bash
npm run devbash
bun devbash
pnpm devbash
yarn devOpens http://localhost:5173. Changes show instantly.
Build for Production
bash
npm run buildbash
bun run buildbash
pnpm buildbash
yarn buildCreates dist/ folder. Upload this to your server.
Why bun run build not bun build?
These are different commands:
| Command | What It Does |
|---|---|
bun build | Uses Bun's bundler |
bun run build | Runs the "build" script in package.json |
We use bun run build because it runs Vite's bundler.
Why Vite, not Bun's bundler?
- Vite has more features
- Vite has more plugins
- Vite is tested with React for years
Bun is fast for running code. Vite is better for building.
Check Code
bash
npm run checkbash
bun checkbash
pnpm checkbash
yarn checkRuns all checks:
- ESLint (find bugs)
- Prettier (check format)
- TypeScript (check types)
Find Bugs (Lint)
bash
npm run lintbash
bun lintbash
pnpm lintbash
yarn lintFix bugs automatically:
bash
npm run lint -- --fixbash
bun lint --fixbash
pnpm lint --fixbash
yarn lint --fixFormat Code
bash
npm run formatbash
bun formatbash
pnpm formatbash
yarn formatMakes code look nice. Fixes spacing, quotes, etc.
Run Tests
bash
npm testbash
bun testbash
pnpm testbash
yarn testRuns tests. Watches for changes.
Run once (for CI):
bash
npm run test:runbash
bun test:runbash
pnpm test:runbash
yarn test:runRemove Demo Content
bash
npm run cleanbash
bun cleanbash
pnpm cleanbash
yarn cleanRemoves demo files. Gives you clean "Hello World" app.
All Commands
| Command | What It Does |
|---|---|
dev | Start dev server |
build | Build for production |
check | Run all checks |
lint | Find bugs |
format | Make code pretty |
test | Run tests (watch) |
test:run | Run tests (once) |
clean | Remove demo files |