# What is Vite used for?

**Vite** is a **modern build tool** used for frontend development. It’s super fast and great for projects using frameworks like React, Vue, Svelte, or even plain HTML/JavaScript. Here’s what it’s used for:

**🔧 What Vite is used for:**

1\. **Local development** with lightning-fast startup and hot module replacement (HMR).

2\. **Building (bundling) your project** for production with optimized performance.

3\. **Support for modern JavaScript** (ES modules), TypeScript, JSX, CSS preprocessors, etc.

4\. **Easy plugin system** – you can extend it to suit your needs.

5\. **Framework support** – works with React, Vue, Preact, Svelte, Lit, and more.

---

**🆚 Compared to older tools like Webpack:**

• **Vite** uses **native ES modules** during development, so no need to bundle everything upfront.

• It’s significantly **faster** for dev and often easier to configure.

---

If you’re building a modern frontend app and want fast startup and good DX (developer experience), **Vite is a great choice**.

To install Vite using npm, you can run the following command in your terminal:

```plaintext
npm create vite@latest
```

This will prompt you to name your project and choose a framework (like Vanilla, Vue, React, etc.). It sets up a new Vite project for you.

If you just want to install Vite in an existing project, use:

```plaintext
npm install vite --save-dev
```

Then, in your package.json, add a script like this:

```plaintext
"scripts": {
  "dev": "vite",
  "build": "vite build",
  "preview": "vite preview"
}
```

Let me know what kind of project you’re setting up—React, Vue, etc.—and I can give you the full setup.W
