Skip to content
Merged

d2m #1530

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
50 changes: 13 additions & 37 deletions guide/static-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,11 @@ $ npm run preview

### Netlify CLI {#netlify-cli}

1. 安装 [Netlify CLI](https://cli.netlify.com/)
2. 使用 `ntl init` 创建一个新站点。
3. 使用 `ntl deploy` 来部署。
1. 通过 `npm install -g netlify-cli` 安装 [Netlify CLI](https://docs.netlify.com/api-and-cli-guides/cli-guides/get-started-with-cli/)

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space before the Chinese period at the end of this line. It should be ) 。)。 to match the convention used throughout the document (e.g., lines 227, 231, 237, etc.).

Suggested change
1. 通过 `npm install -g netlify-cli` 安装 [Netlify CLI](https://docs.netlify.com/api-and-cli-guides/cli-guides/get-started-with-cli/)
1. 通过 `npm install -g netlify-cli` 安装 [Netlify CLI](https://docs.netlify.com/api-and-cli-guides/cli-guides/get-started-with-cli/)

Copilot uses AI. Check for mistakes.
2. 使用 `netlify init` 创建一个新站点。
3. 使用 `netlify deploy` 来部署。

```bash
# 安装 Netlify CLI
$ npm install -g netlify-cli

# 在 Netlify 中创建一个新站点
$ ntl init

# 部署一个独一无二的预览 URL
$ ntl deploy
```

Netlify CLI 会给你分享一个预览的 URL 来检查部署结果。当你准备好了发布生产版本时,请使用 `prod` 标志:

```bash
# 部署站点到生产环境
$ ntl deploy --prod
```
Netlify 命令行工具(CLI)会为你提供一个预览链接,供你查看效果。当你准备发布到生产环境时,可使用 `prod` 参数执行命令:`netlify deploy --prod`。

### Netlify with Git {#netlify-with-git}

Expand All @@ -149,18 +133,10 @@ $ ntl deploy --prod

### Vercel CLI {#vercel-cli}

1. 安装 [Vercel CLI](https://vercel.com/cli) 并运行 `vercel` 来部署
1. 通过 `npm i -g vercel` 命令安装 [Vercel CLI](https://vercel.com/cli),然后运行 vercel 命令完成部署

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word "vercel" should be wrapped in backticks to match the convention used throughout the document when referring to commands. It should read: "然后运行 vercel 命令完成部署" instead of "然后运行 vercel 命令完成部署".

Suggested change
1. 通过 `npm i -g vercel` 命令安装 [Vercel CLI](https://vercel.com/cli),然后运行 vercel 命令完成部署。
1. 通过 `npm i -g vercel` 命令安装 [Vercel CLI](https://vercel.com/cli),然后运行 `vercel` 命令完成部署。

Copilot uses AI. Check for mistakes.
2. Vercel 会检测到你正在使用 Vite,并会为你开启相应的正确配置。
3. 你的应用被部署好了!(示例:[vite-vue-template.vercel.app](https://vite-vue-template.vercel.app/))

```bash
$ npm i -g vercel
$ vercel init vite
Vercel CLI
> Success! Initialized "vite" example in ~/your-folder.
- To deploy, `cd vite` and run `vercel`.
```

### Vercel for Git {#vercel-for-git}

1. 将你的代码推送到远程仓库(GitHub,GitLab,Bitbucket)
Expand Down Expand Up @@ -213,9 +189,11 @@ $ npx wrangler pages deploy dist

## Google Firebase {#google-firebase}

1. 确保已经安装 [firebase-tools](https://www.npmjs.com/package/firebase-tools)。
1. 通过 `npm i -g firebase-tools` 命令安装 [firebase-tools](https://www.npmjs.com/package/firebase-tools) 工具。

2. 在你的项目根目录下创建以下文件:

2. 在项目根目录创建 `firebase.json` 和 `.firebaserc` 两个文件,包含以下内容:
::: code-group

```json [firebase.json]
{
Expand All @@ -240,14 +218,14 @@ $ npx wrangler pages deploy dist
}
```

:::

3. 运行 `npm run build` 后,通过 `firebase deploy` 命令部署。

## Surge {#surge}

1. 首先确保已经安装 [surge](https://www.npmjs.com/package/surge)。

1. 通过 `npm i -g surge` 命令安装 [surge](https://www.npmjs.com/package/surge)。
2. 运行 `npm run build`。

3. 运行 `surge dist` 命令部署到 surge。

你也可以通过添加 `surge dist yourdomain.com` 部署到一个 [自定义域名](https://surge.sh/help/adding-a-custom-domain)。
Expand Down Expand Up @@ -281,9 +259,7 @@ $ npx wrangler pages deploy dist
- **构建命令**:`npm install && npm run build`
- **发布目录**:`dist`

5. 点击 **Create Static Site**

你的应用将会被部署在 `https://<PROJECTNAME>.onrender.com/`。
5. 点击 **Create Static Site**, 你的应用将会被部署在 `https://<PROJECTNAME>.onrender.com/`。

默认情况下,推送到该指定分支的任何新的 commit 都会自动触发一个新的部署。[Auto-Deploy](https://render.com/docs/deploys#toggling-auto-deploy-for-a-service) 可以在项目设置中部署。

Expand Down