Files
tldr/pages.zh/common/vite.md

22 lines
673 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Vite
> 创建一个 Vite 项目。
> 用于构建 JavaScript 项目。
> 可用模板vanilla、vanilla-ts、vue、vue-ts、react、react-ts、react-swc、react-swc-ts、preact、preact-ts、lit、lit-ts、svelte、svelte-ts。
> 更多信息:<https://vitejs.dev/guide>。
- 使用 `npm` 6.x 进行设置:
`npm create vite@latest my-react-app --template react-ts`
- 使用 `npm` 7+ 进行设置,需要额外的双破折号:
`npm create vite@latest my-react-app -- --template react-ts`
- 使用 `yarn` 进行设置:
`yarn create vite my-react-app --template react-ts`
- 使用 `pnpm` 进行设置:
`pnpm create vite my-react-app --template react-ts`