Skip to content

Commit

Permalink
docs: add commands in code groups to enhance clarity and ease of use
Browse files Browse the repository at this point in the history
Added three code groups to enhance clarity and easy of use: 

1. Added commands (used to scaffold inside an existing directory) in a code group. 

2. Updated commands (used to specify a project name and template) in a code group. 

3. Added commands (used to scaffold with a template inside an existing directory) in a code group.
  • Loading branch information
BhanuVikram committed Jun 5, 2024
1 parent a8c7083 commit 08bb517
Showing 1 changed file with 60 additions and 6 deletions.
66 changes: 60 additions & 6 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,81 @@ $ bun create vite

:::


You can use `.` to scaffold inside an existing directory.

::: code-group

```bash [NPM]
$ npm create vite@latest .
```

```bash [Yarn]
$ yarn create vite .
```

```bash [PNPM]
$ pnpm create vite .
```

```bash [Bun]
$ bun create vite .
```

:::


Then follow the prompts!

You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run:

```bash
::: code-group

```bash [NPM]
# npm 7+, extra double-dash is needed:
npm create vite@latest my-vue-app -- --template vue
```

# yarn
```bash [Yarn]
yarn create vite my-vue-app --template vue
```

# pnpm
```bash [PNPM]
pnpm create vite my-vue-app --template vue
```

# bun
```bash [Bun]
bun create vite my-vue-app --template vue
```

See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`, `solid`, `solid-ts`, `qwik`, `qwik-ts`.
:::


You can use `.` for the project name to scaffold in the current directory.

::: code-group

```bash [NPM]
# npm 7+, extra double-dash is needed:
npm create vite@latest . -- --template vue
```

You can use `.` for the project name to scaffold in the current directory.
```bash [Yarn]
yarn create vite . --template vue
```

```bash [PNPM]
pnpm create vite . --template vue
```

```bash [Bun]
bun create vite . --template vue
```

:::


See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`, `solid`, `solid-ts`, `qwik`, `qwik-ts`.

## Community Templates

Expand Down

0 comments on commit 08bb517

Please sign in to comment.