Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge docs-cn/sync-docs into docs-cn/dev @ 9b4dc24a #808

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 30 additions & 22 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,37 @@ export default defineConfig({
{ text: 'Team', link: '/team' },
{ text: 'Releases', link: '/releases' },
{
text: 'Twitter',
link: 'https://twitter.com/vite_js'
items: [
{
text: 'Twitter',
link: 'https://twitter.com/vite_js',
},
{
text: 'Discord 聊天室',
link: 'https://chat.vitejs.dev'
},
{
text: 'Awesome Vite',
link: 'https://github.com/vitejs/awesome-vite'
},
{
text: 'Dev.to 社区',
link: 'https://dev.to/t/vite'
},
{
text: 'Rollup 插件兼容',
link: 'https://vite-rollup-plugins.patak.dev/'
},
{
text: '更新日志',
link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md'
},
{
text: '贡献指南',
link: 'https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md',
},
],
},
{
text: 'Discord Chat',
link: 'https://chat.vitejs.dev'
},
{
text: 'Awesome Vite',
link: 'https://github.com/vitejs/awesome-vite'
},
{
text: 'Dev.to 社区',
link: 'https://dev.to/t/vite'
},
{
text: 'Rollup 插件兼容',
link: 'https://vite-rollup-plugins.patak.dev/'
},
{
text: '更新日志',
link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md'
}
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions guide/assets.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 静态资源处理 {#static-asset-handling}

- 相关: [公共基础路径](./build#public-base-path)
Expand Down
4 changes: 4 additions & 0 deletions guide/cli.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 命令行界面 {#command-line-interface}

## 开发服务器 {#dev-server}
Expand Down
4 changes: 4 additions & 0 deletions guide/dep-pre-bundling.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 依赖预构建 {#dependency-pre-bundling}

当你首次启动 `vite` 时,Vite 在本地加载你的站点之前预构建了项目依赖。默认情况下,它是自动且透明地完成的。
Expand Down
14 changes: 6 additions & 8 deletions guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,22 @@ Vite 还提供了强大的扩展性,可通过其 [插件 API](./api-plugin)
Vite 需要 [Node.js](https://nodejs.org/en/) 版本 14.18+,16+。然而,有些模板需要依赖更高的 Node 版本才能正常运行,当你的包管理器发出警告时,请注意升级你的 Node 版本。
:::

使用 NPM:
::: code-group

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

使用 Yarn:

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

使用 PNPM:

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

:::

然后按照提示操作即可!

你还可以通过附加的命令行选项直接指定项目名称和你想要使用的模板。例如,要构建一个 Vite + Vue 项目,运行:
Expand Down
2 changes: 2 additions & 0 deletions guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ vite build --profile

Node.js 调试器将在根文件夹中生成 `vite-profile-0.cpuprofile` 文件,前往 https://www.speedscope.app/,点击 `BROWSE` 按钮上传 CPU 性能分析文件以检查结果。

可以安装 [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) 插件,它可以让你检查 Vite 插件转换时的中间态,并帮助你确定哪些插件或中间件是你应用的瓶颈。该插件可以在开发和构建模式下使用。请查看其 readme 以获取更多详细信息。

## 其他 {#others}

### 为了浏览器兼容性而模块外部化 {#module-externalized-for-browser-compatibility}
Expand Down
4 changes: 4 additions & 0 deletions guide/why.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 为什么选 Vite {#why-vite}

## 现实问题 {#the-problems}
Expand Down