StealThis .dev

Vue 3 + Vite Starter

Official Vue 3 starter with Vite, TypeScript, Vue Router, Pinia state management, and Composition API. Interactive CLI with optional features.

Lab에서 열기
vue vite typescript
Targets: HTML

Code

Vue 3 + Vite Starter

The official create-vue scaffolding tool builds a Vue 3 project powered by Vite with an interactive CLI that lets you pick exactly the features you need: TypeScript, Vue Router, Pinia, Vitest, ESLint, and Prettier.

Quick Start

npm create vue@latest my-app
cd my-app
npm install
npm run dev

The interactive prompts let you toggle TypeScript, JSX, Vue Router, Pinia, Vitest, E2E testing (Cypress/Playwright), ESLint, and Prettier.

What You Get

  • Vue 3 Composition API<script setup> with reactive refs, computed properties, and composables
  • Vite — Instant dev server, native ESM, optimized production builds
  • TypeScript — Full type inference for props, emits, slots, and the template
  • Vue Router — File-based mental model with nested routes, guards, and lazy loading
  • Pinia — Lightweight, type-safe state management replacing Vuex
  • Vitest — Vite-native testing (optional)
  • ESLint + Prettier — Code quality and formatting (optional)

Generated Project Structure

my-app/
├── public/
│   └── favicon.ico
├── src/
│   ├── assets/
│   │   └── main.css
│   ├── components/
│   │   ├── HelloWorld.vue
│   │   └── icons/
│   ├── router/
│   │   └── index.ts
│   ├── stores/
│   │   └── counter.ts
│   ├── views/
│   │   ├── AboutView.vue
│   │   └── HomeView.vue
│   ├── App.vue
│   └── main.ts
├── index.html
├── package.json
├── tsconfig.json
├── vite.config.ts
└── env.d.ts

Key Files

  • vite.config.ts — Vue plugin, path aliases (@/ maps to src/), dev server options.
  • src/router/index.ts — Route definitions with createRouter and createWebHistory.
  • src/stores/counter.ts — Example Pinia store using defineStore with Composition API syntax.
  • src/App.vue — Root component with <RouterView /> for page rendering.

Extend With

ToolPurpose
UnoCSSInstant atomic CSS engine, Tailwind-compatible
Vue I18nInternationalization with message compilation
VueUse200+ composable utility functions
NuxtFull-stack framework with SSR, auto-imports, and file-based routing
PrimeVueRich UI component library

References

  • Vue Quick Start — Official guide to scaffolding and developing Vue applications
  • antfu-collective/vitesse (9.4k+ stars) — Opinionated community starter with UnoCSS, auto-imports, file-based routing, and PWA support