A modern, production-ready Vue 3 starter template with TypeScript, Vite, Tailwind CSS v4, ESLint, Prettier, and DevContainer support.
- π― Vue 3 - Composition API with
<script setup>syntax - π· TypeScript - Full type safety and IntelliSense
- β‘ Vite - Lightning-fast HMR and optimized builds
- π¨ Tailwind CSS v4 - Modern utility-first CSS framework
- π§ Vue Router - File-based routing architecture
- π ESLint 9 - Flat config with type-aware linting
- π Prettier - Automatic code formatting
- π³ DevContainer - Consistent development environment across teams
- π Auto Format - Format and fix on save
- π¦ pnpm - Fast, efficient package management
cd main
pnpm install
pnpm devOpen http://localhost:5173 in your browser.
- Open the project in VSCode
- Open
vue-template.code-workspacefile - Click "Reopen in Container" when prompted
- Or press
Cmd/Ctrl + Shift + Pβ "Dev Containers: Reopen in Container"
- Or press
- Dev server will start automatically at
http://localhost:5173
Note: DevContainer provides a consistent, isolated development environment with all dependencies pre-configured.
.
βββ .devcontainer/ # DevContainer configuration
β βββ devcontainer.json # Container setup and extensions
βββ .vscode/ # VSCode settings (for local development)
β βββ settings.json # Editor settings
β βββ extensions.json # Recommended extensions
βββ main/ # Main Vue 3 application
β βββ src/
β β βββ app/ # Application core
β β β βββ index.html # HTML entry point
β β β βββ providers/ # App-level providers (routers, etc.)
β β βββ pages/ # Page components
β β β βββ home/
β β β βββ notfound/
β β βββ shared/ # Shared utilities and configs
β β β βββ router/ # Router configuration
β β βββ App.vue # Root component
β β βββ main.ts # Application entry point
β βββ eslint.config.mjs # ESLint flat config
β βββ prettier.config.mjs # Prettier configuration
β βββ tsconfig.json # TypeScript configuration
β βββ vite.config.ts # Vite configuration
β βββ package.json # Dependencies and scripts
βββ vue-template.code-workspace # VSCode workspace configuration
Navigate to the main directory first: cd main
# Development
pnpm dev # Start development server with HMR
# Build
pnpm build # Build optimized production bundle
pnpm preview # Preview production build locally
# Code Quality
pnpm lint # Lint and auto-fix issues
pnpm lint:check # Check for lint errors (no fixing)
pnpm format # Format code with Prettier
pnpm format:check # Check code formatting (no fixing)
# Type Checking
pnpm type-check # Run TypeScript type checkingUses ESLint 9 with modern flat config format:
- β
TypeScript ESLint with type-aware linting via
projectService - β Vue 3 recommended rules
- β Prettier integration (no style conflicts)
- β Auto-fix on save enabled
Consistent code formatting with:
- Single quotes for strings (except CSS files - uses double quotes for Tailwind v4)
- Trailing commas (ES5 style)
- 120 character print width
- 2 spaces indentation
- Tailwind CSS v4 class sorting via
prettier-plugin-tailwindcss
Strict type checking enabled with:
strict: true- All strict type checks- Path aliases configured (
@/βsrc/) - Vue 3 type definitions included
This template can be extended with MSW for API mocking during development and testing.
Basic setup (run inside the main directory):
cd main
npx msw init ./public --saveThis command will generate the MSW mockServiceWorker.js in the public folder and register it for use in your app.
This project uses Tailwind CSS v4 with the new @import and @source directives.
In main/src/app/styles/main.css:
@import 'tailwindcss';
@source '../../../src';Why @source is critical:
- β Without
@source: Tailwind only generates base styles and theme variables - β No utility classes: Classes like
text-3xl,font-bold,bg-blue-500won't work - β
With
@source: Tailwind scans your source files and generates all needed utility classes
Path breakdown:
main/src/app/styles/main.css (current file)
β
@source '../../../src'
β
main/src/ (scans all .vue, .ts, .tsx files)
Special override for CSS files to preserve double quotes (required for Tailwind v4):
overrides: [
{
files: '*.css',
options: {
singleQuote: false, // Keep double quotes in CSS
},
},
]Pre-configured development container includes:
- Node.js 20 LTS
- pnpm package manager
- All required VSCode extensions
- Auto port forwarding (
5173,4173) - Automatic
pnpm installon container creation - Git configuration preserved
Local Development:
code vue-template.code-workspaceDevContainer Development:
- Open workspace file β VSCode automatically detects DevContainer
- Settings in workspace apply to both local and container environments
- Automatic: Code formats and fixes automatically on save
- Manual Format: Press
Shift + Alt + F(Windows/Linux) orShift + Option + F(Mac) - Command Line: Run
pnpm lintto lint the entire project
Vite provides instant HMR - your changes appear in the browser without full page reloads.
| Port | Service | Description |
|---|---|---|
5173 |
Vite Dev Server | Development server with HMR |
4173 |
Vite Preview | Preview production build locally |
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Built with β€οΈ using Vue 3 and TypeScript