Setting Up Your Vue Development Environment
Before building Vue applications, you need to set up a proper development environment. This lesson covers all the tools you'll need.
Prerequisites
Creating a Vue Project
Option 1: Using Vite (Recommended) ⚡
Vite is the recommended way to scaffold Vue projects. It's created by Evan You, the creator of Vue.
bash# Create a new Vue project with Vite npm create vue@latest # Or with specific template npm create vite@latest my-vue-app -- --template vue-ts
Interactive Setup
After setup, run these commands:
bashcd my-vue-project npm install npm run dev
Success!
Your Vue app is now running at http://localhost:5173
Option 2: Using Nuxt (Full-Stack)
For full-stack applications with SSR, SSG, and more:
bashnpx nuxi@latest init my-nuxt-app cd my-nuxt-app npm install npm run dev
IDE Setup
VS Code Extensions
Recommended Extensions
Vue - Official (Volar)
Essential extension for Vue.js development with TypeScript support
Vue.volarTypeScript Vue Plugin
Enhanced TypeScript support for Vue SFCs
Vue.vscode-typescript-vue-pluginESLint
Integrates ESLint into VS Code for code quality
dbaeumer.vscode-eslintPrettier
Code formatter supporting Vue SFC files
esbenp.prettier-vscodeVS Code Settings
Add these settings to your .vscode/settings.json:
json{ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "[vue]": { "editor.defaultFormatter": "Vue.volar" }, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, "typescript.tsdk": "node_modules/typescript/lib", "vue.inlayHints.missingProps": true, "vue.inlayHints.inlineHandlerLeading": true }
Essential Configuration Files
Common Commands
npm run devStart dev servernpm run buildBuild for productionnpm run previewPreview production buildnpm run test:unitRun unit testsnpm run lintLint and fix filesNext Steps
Next Lesson
Template Syntax & Reactivity