Skip to content

Commit 912e841

Browse files
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ 842e1ad
2 parents af0322b + e94dc39 commit 912e841

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

blog/announcing-vite2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Vite 1.0 虽然之前进入了 RC 阶段,但在发布之前我们决定进行
2424

2525
设计 Vite 的初衷是为了 [探索黑客原型项目以更好的支持 Vue 单文件组件](https://github.com/vuejs/vue-dev-server)。Vite 1 则是这个想法的延续,并在此基础上增加了对 HMR 支持。
2626

27-
但 2.0 基于之前的经验提供了一个更稳定灵活的内部架构,从而可以完全通过插件机制来支持任意框架。现在 Vite 提供 [官方的 Vue, React, Preact, Lit Element 项目模版](https://github.com/vitejs/vite/tree/main/packages/create-app),而 Svelte 社区也在开发 Vite 整合方案。
27+
但 2.0 基于之前的经验提供了一个更稳定灵活的内部架构,从而可以完全通过插件机制来支持任意框架。现在 Vite 提供 [官方的 Vue, React, Preact, Lit Element 项目模版](https://github.com/vitejs/vite/tree/main/packages/create-vite),而 Svelte 社区也在开发 Vite 整合方案。
2828

2929
### 全新插件机制和 API {#new-plugin-format-and-api}
3030

guide/features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Vite 通过 HTTP 头来缓存请求得到的依赖,所以如果你想要编辑
2424

2525
Vite 提供了一套原生 ESM 的 [HMR API](./api-hmr)。 具有 HMR 功能的框架可以利用该 API 提供即时、准确的更新,而无需重新加载页面或清除应用程序状态。Vite 内置了 HMR 到 [Vue 单文件组件(SFC)](https://github.com/vitejs/vite/tree/main/packages/plugin-vue)[React Fast Refresh](https://github.com/vitejs/vite/tree/main/packages/plugin-react-refresh) 中。也通过 [@prefresh/vite](https://github.com/JoviDeCroock/prefresh/tree/main/packages/vite) 对 Preact 实现了官方集成。
2626

27-
注意,你不需要手动设置这些 —— 当你 [create an app via `@vitejs/create-app`](./) 创建应用程序时,所选模板已经为你预先配置了这些。
27+
注意,你不需要手动设置这些 —— 当你 [create an app via `create-vite`](./) 创建应用程序时,所选模板已经为你预先配置了这些。
2828

2929
## TypeScript {#typescript}
3030

guide/index.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ Vite 需要 [Node.js](https://nodejs.org/en/) 版本 >= 12.0.0。
2525
使用 NPM:
2626

2727
```bash
28-
$ npm init @vitejs/app
28+
$ npm init vite@latest
2929
```
3030

3131
使用 Yarn:
3232

3333
```bash
34-
$ yarn create @vitejs/app
34+
$ yarn create vite
35+
```
36+
37+
With PNPM:
38+
39+
```bash
40+
$ pnpx create-vite
3541
```
3642

3743
然后按照提示操作即可!
@@ -40,13 +46,13 @@ $ yarn create @vitejs/app
4046

4147
```bash
4248
# npm 6.x
43-
npm init @vitejs/app my-vue-app --template vue
49+
npm init vite@latest my-vue-app --template vue
4450

4551
# npm 7+, 需要额外的双横线:
46-
npm init @vitejs/app my-vue-app -- --template vue
52+
npm init vite@latest my-vue-app -- --template vue
4753

4854
# yarn
49-
yarn create @vitejs/app my-vue-app --template vue
55+
yarn create vite my-vue-app --template vue
5056
```
5157

5258
支持的模板预设包括:
@@ -64,11 +70,11 @@ yarn create @vitejs/app my-vue-app --template vue
6470
- `svelte`
6571
- `svelte-ts`
6672

67-
查看 [@vitejs/create-app](https://github.com/vitejs/vite/tree/main/packages/create-app) 获取每个模板的更多细节
73+
查看 [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) 以获取每个模板的更多细节
6874

6975
## 社区模板 {#community-templates}
7076

71-
@vitejs/create-app 是一个快速生成主流框架基础模板的工具。查看 Awesome Vite 仓库的 [社区维护模板](https://github.com/vitejs/awesome-vite#templates),里面包含各种工具和不同框架的模板。你可以用如 [degit](https://github.com/Rich-Harris/degit) 之类的工具,使用社区模版来搭建项目。
77+
create-vite 是一个快速生成主流框架基础模板的工具。查看 Awesome Vite 仓库的 [社区维护模板](https://github.com/vitejs/awesome-vite#templates),里面包含各种工具和不同框架的模板。你可以用如 [degit](https://github.com/Rich-Harris/degit) 之类的工具,使用社区模版来搭建项目。
7278

7379
```bash
7480
npx degit user/project my-project

0 commit comments

Comments
 (0)