From 5739393baa2035bf6e270770e3e1b46afbfc0af9 Mon Sep 17 00:00:00 2001 From: Howard Chiam Date: Wed, 5 Jun 2024 19:15:11 -0600 Subject: [PATCH 1/5] docs(guide): explicitly mention how to install vite (#16583) --- docs/guide/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/guide/index.md b/docs/guide/index.md index f76d0237918472..6d3173bd2f4d75 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -122,6 +122,10 @@ Note that Vite will also resolve [its config file (i.e. `vite.config.js`)](/conf ## Command Line Interface +You can install the CLI command `vite` globally with `npm install -g vite` or `yarn global add vite`. + +Or install it for a specific project with `npm install vite` or `yarn add vite`. + In a project where Vite is installed, you can use the `vite` binary in your npm scripts, or run it directly with `npx vite`. Here are the default npm scripts in a scaffolded Vite project: From e3c8278dc7a58aa738675fe35c449de30344ce58 Mon Sep 17 00:00:00 2001 From: Howard Chiam Date: Thu, 6 Jun 2024 20:44:27 -0600 Subject: [PATCH 2/5] docs(guide): how to install vite for project + minimal index.html demo (vitejs#16583) --- docs/guide/index.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index 6d3173bd2f4d75..5d2adff1a8027d 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -105,6 +105,34 @@ npm install npm run dev ``` +## Install `vite` Command + +You can install the CLI command `vite` for your project using: + +```bash +npm install vite +``` + +Or with yarn: + +```bash +yarn add vite +``` + +Now you can create an index.html file like this: + +```html +

Hello Vite!

+``` + +Then simply run: + +```bash +vite +``` + +And index.html will be served on http://localhost:5173 + ## `index.html` and Project Root One thing you may have noticed is that in a Vite project, `index.html` is front-and-central instead of being tucked away inside `public`. This is intentional: during development Vite is a server, and `index.html` is the entry point to your application. @@ -122,10 +150,6 @@ Note that Vite will also resolve [its config file (i.e. `vite.config.js`)](/conf ## Command Line Interface -You can install the CLI command `vite` globally with `npm install -g vite` or `yarn global add vite`. - -Or install it for a specific project with `npm install vite` or `yarn add vite`. - In a project where Vite is installed, you can use the `vite` binary in your npm scripts, or run it directly with `npx vite`. Here are the default npm scripts in a scaffolded Vite project: From 12e8d795390e9bd5f638dc237ac9d861b51aff49 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 10 Jun 2024 21:56:08 +0800 Subject: [PATCH 3/5] docs: update --- docs/guide/index.md | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index 5d2adff1a8027d..c1ac63b5eaa109 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -105,33 +105,43 @@ npm install npm run dev ``` -## Install `vite` Command +## Manual Installation -You can install the CLI command `vite` for your project using: +In your project, you can install the `vite` CLI using: -```bash -npm install vite +::: code-group + +```bash [NPM] +$ npm install -D vite ``` -Or with yarn: +```bash [Yarn] +$ yarn add -D vite +``` -```bash -yarn add vite +```bash [PNPM] +$ pnpm add -D vite +``` + +```bash [Bun] +$ bun add -D vite ``` -Now you can create an index.html file like this: +::: + +And create an `index.html` file like this: ```html

Hello Vite!

``` -Then simply run: +Then simply run the `vite` CLI in your terminal: ```bash vite ``` -And index.html will be served on http://localhost:5173 +The `index.html` will be served on http://localhost:5173. ## `index.html` and Project Root From 4a6236d14801a2cc16da0bfa4f1d36e459913c92 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 10 Jun 2024 21:59:35 +0800 Subject: [PATCH 4/5] chore: fix deadlink --- docs/guide/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index c1ac63b5eaa109..71d3be62b1a424 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -141,7 +141,7 @@ Then simply run the `vite` CLI in your terminal: vite ``` -The `index.html` will be served on http://localhost:5173. +The `index.html` will be served on `http://localhost:5173`. ## `index.html` and Project Root From 2bfb518a6ae8eb22c26eb70f5d61b5b0c5e431fb Mon Sep 17 00:00:00 2001 From: patak <583075+patak-dev@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:46:15 +0200 Subject: [PATCH 5/5] chore: avoid simply --- docs/guide/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index 71d3be62b1a424..57eb89eb0053fd 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -135,7 +135,7 @@ And create an `index.html` file like this:

Hello Vite!

``` -Then simply run the `vite` CLI in your terminal: +Then run the `vite` CLI in your terminal: ```bash vite