Skip to content

Commit 7a31518

Browse files
authored
Merge pull request #973 from vitejs/sync-cfa53198-1
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ cfa5319
2 parents 67be463 + ec25c03 commit 7a31518

File tree

6 files changed

+163
-85
lines changed

6 files changed

+163
-85
lines changed

blog/announcing-vite3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ head:
2929

3030
_July 23, 2022_ - Check out the [Vite 4.0 announcement](./announcing-vite4.md)
3131

32-
In February last year, [Evan You](https://twitter.com/youyuxi) released Vite 2. Since then, its adoption has grown non-stop, reaching more than 1 million npm downloads per week. A sprawling ecosystem rapidly formed after the release. Vite is powering a renewed innovation race in Web frameworks. [Nuxt 3](https://v3.nuxtjs.org/) uses Vite by default. [SvelteKit](https://kit.svelte.dev/), [Astro](https://astro.build/), [Hydrogen](https://hydrogen.shopify.dev/), and [SolidStart](https://docs.solidjs.com/start) are all built with Vite. [Laravel has now decided to use Vite by default](https://laravel.com/docs/9.x/vite). [Vite Ruby](https://vite-ruby.netlify.app/) shows how Vite can improve Rails DX. [Vitest](https://vitest.dev) is making strides as a Vite-native alternative to Jest. Vite is behind [Cypress](https://docs.cypress.io/guides/component-testing/writing-your-first-component-test) and [Playwright](https://playwright.dev/docs/test-components)'s new Component Testing features, Storybook has [Vite as an official builder](https://github.com/storybookjs/builder-vite). And [the list goes on](https://patak.dev/vite/ecosystem.html). Maintainers from most of these projects got involved in improving the Vite core itself, working closely with the Vite [team](https://vitejs.dev/team) and other contributors.
32+
In February last year, [Evan You](https://twitter.com/youyuxi) released Vite 2. Since then, its adoption has grown non-stop, reaching more than 1 million npm downloads per week. A sprawling ecosystem rapidly formed after the release. Vite is powering a renewed innovation race in Web frameworks. [Nuxt 3](https://v3.nuxtjs.org/) uses Vite by default. [SvelteKit](https://kit.svelte.dev/), [Astro](https://astro.build/), [Hydrogen](https://hydrogen.shopify.dev/), and [SolidStart](https://docs.solidjs.com/quick-start) are all built with Vite. [Laravel has now decided to use Vite by default](https://laravel.com/docs/9.x/vite). [Vite Ruby](https://vite-ruby.netlify.app/) shows how Vite can improve Rails DX. [Vitest](https://vitest.dev) is making strides as a Vite-native alternative to Jest. Vite is behind [Cypress](https://docs.cypress.io/guides/component-testing/writing-your-first-component-test) and [Playwright](https://playwright.dev/docs/test-components)'s new Component Testing features, Storybook has [Vite as an official builder](https://github.com/storybookjs/builder-vite). And [the list goes on](https://patak.dev/vite/ecosystem.html). Maintainers from most of these projects got involved in improving the Vite core itself, working closely with the Vite [team](https://vitejs.dev/team) and other contributors.
3333

3434
![Vite 3 Announcement Cover Image](/og-image-announcing-vite3.png)
3535

guide/env-and-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ interface ImportMeta {
9494
}
9595
```
9696
97-
如果你的代码依赖于浏览器环境的类型,比如 [DOM](https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts) 和 [WebWorker](https://github.com/microsoft/TypeScript/blob/main/lib/lib.webworker.d.ts),你可以在 `tsconfig.json` 中修改 [lib](https://www.typescriptlang.org/tsconfig#lib) 字段来获取类型支持。
97+
如果你的代码依赖于浏览器环境的类型,比如 [DOM](https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts) 和 [WebWorker](https://github.com/microsoft/TypeScript/blob/main/src/lib/webworker.generated.d.ts),你可以在 `tsconfig.json` 中修改 [lib](https://www.typescriptlang.org/tsconfig#lib) 字段来获取类型支持。
9898
9999
```json
100100
{

guide/index.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,44 @@ npm install
105105
npm run dev
106106
```
107107

108+
## 手动安装 {#manual-installation}
109+
110+
在你的项目中,可以用以下方法来安装 `vite` 命令行工具:
111+
112+
::: code-group
113+
114+
```bash [NPM]
115+
$ npm install -D vite
116+
```
117+
118+
```bash [Yarn]
119+
$ yarn add -D vite
120+
```
121+
122+
```bash [PNPM]
123+
$ pnpm add -D vite
124+
```
125+
126+
```bash [Bun]
127+
$ bun add -D vite
128+
```
129+
130+
:::
131+
132+
并创建一个像这样的 `index.html` 文件:
133+
134+
```html
135+
<p>Hello Vite!</p>
136+
```
137+
138+
然后在终端中运行 `vite`
139+
140+
```bash
141+
vite
142+
```
143+
144+
就可以在 `http://localhost:5173` 上访问 `index.html`
145+
108146
## `index.html` 与项目根目录 {#index-html-and-project-root}
109147

110148
你可能已经注意到,在一个 Vite 项目中,`index.html` 在项目最外层而不是在 `public` 文件夹内。这是有意而为之的:在开发期间 Vite 是一个服务器,而 `index.html` 是该 Vite 项目的入口文件。

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
"private": true,
99
"license": "CC BY-NC-SA 4.0",
1010
"devDependencies": {
11-
"@types/node": "^20.9.2",
11+
"@shikijs/vitepress-twoslash": "^1.7.0",
12+
"@types/express": "^4.17.21",
13+
"feed": "^4.2.2",
14+
"vitepress": "1.2.3",
15+
"vue": "^3.4.29",
16+
"@types/node": "^20.9.2",
1217
"chalk": "^4.1.2",
1318
"gray-matter": "^4.0.3",
1419
"lodash": "^4.17.21",
1520
"vite": "^5.1.6",
16-
"feed": "^4.2.2",
17-
"yorkie": "^2.0.0",
18-
"@shikijs/vitepress-twoslash": "^1.6.3",
19-
"@types/express": "^4.17.21",
20-
"vitepress": "1.2.3",
21-
"vue": "^3.4.27"
21+
"yorkie": "^2.0.0"
2222
},
2323
"scripts": {
2424
"dev": "vitepress dev .",

0 commit comments

Comments
 (0)