Tooling
Vue.js offers a comprehensive tooling ecosystem to streamline development, from build systems to testing frameworks. This guide covers the essential tools and configurations used in Vue projects.Build System
Package Manager
Vue core uses pnpm as its package manager (version 10.30.2). The project enforces this with a preinstall hook:Build Scripts
The Vue core repository includes several build scripts in thescripts/ directory:
Development Build
dev.js script supports:
- Watch mode for automatic rebuilds
- Multiple format outputs (ESM, CJS, global)
- Source maps
- Development-only builds
Production Build
build.js script provides:
- Parallel builds using all CPU cores
- Multiple output formats
- Size reporting (min, gzip, brotli)
- TypeScript declaration generation
- Rollup-based bundling
Build Configuration
Output Formats
Vue supports multiple build formats:- esm-bundler: For bundlers like Vite and webpack
- esm-browser: For native ES module imports in browsers
- cjs: CommonJS for Node.js
- global: IIFE for direct
<script>tag usage
Build Options
Packages define build options in theirpackage.json:
Development Environment
Node.js Version
Vue requires Node.js 20.0.0 or higher:TypeScript Configuration
Vue uses TypeScript 5.6.2 with strict type checking:Git Hooks
The project usessimple-git-hooks for pre-commit and commit message validation:
Lint-Staged
Automatic formatting and linting on commit:Code Quality Tools
ESLint
Vue uses ESLint 10.0.2 with custom configurations:Prettier
Consistent code formatting:Bundlers
Rollup
Vue core uses Rollup 4.59.0 for building packages with plugins:@rollup/plugin-alias- Module aliasing@rollup/plugin-commonjs- CommonJS to ES6@rollup/plugin-json- JSON imports@rollup/plugin-node-resolve- Node module resolution@rollup/plugin-replace- String replacementrollup-plugin-esbuild- Fast transpilation with esbuild
Vite
Recommended for Vue applications:- Lightning-fast HMR
- Optimized builds
- Built-in SFC support with
@vitejs/plugin-vue - TypeScript support out of the box
Development Workflows
SFC Playground
Local development environment for testing SFCs:- Multiple watch processes for different packages
- Vite dev server for the playground
- Hot reload for all changes
Template Explorer
Visual tool for exploring template compilation:Size Analysis
Monitor bundle sizes:Performance Tools
Benchmarking
Vitest-based benchmarks:Bundle Analysis
The build system automatically reports sizes:SFC Tooling Integration
Vite Plugin
Official Vite plugin for Vue SFCs:Webpack Loader
For webpack-based projects:IDE Support
Volar
Official VS Code extension for Vue:- TypeScript support in SFCs
- Template type checking
- Auto-completion
- Error diagnostics
Language Server
Vue Language Server provides IDE features:Release Process
Automated release workflow:- Prompts for version bump
- Runs tests
- Builds all packages
- Updates package.json files
- Creates git tags
- Generates changelog
- Publishes to npm