โœฆ 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.

Open in 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