🍃 Leaf

Vite

Initialization

npm create vite@latest <project-name> -- --template <template-option>

Template options:

More at Getting Started (vitejs.dev).

Usage

vite <command> [option]
# Use with npm scripts
npm run dev
npm run build
npm run preview
// package.json e.g.:
{
  "scripts": {
    "dev": "vite --port <port-number> --open --host",
    "build": "tsc && vite build",
    "preview": "vite preview --port <port-number> --open --host"
  }
}

Commands:

More at Command Line Interface (vitejs.dev).