You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are deploying to `https://<USERNAME>.github.io/`, you can omit `publicPath` as it defaults to `"/"`.
45
-
46
-
If you are deploying to `https://<USERNAME>.github.io/<REPO>/`, (i.e. your repository is at `https://github.com/<USERNAME>/<REPO>`), set `publicPath` to `"/<REPO>/"`. For example, if your repo name is "my-project", your `vue.config.js` should look like this:
You can also run the above script in your CIsetup to enable automatic deployment on each push.
87
+
您还可以在 CI设置中配置上述脚本,以便在每次推送时启用自动部署。
88
88
:::
89
89
90
90
### GitLab Pages
91
91
92
-
As described by [GitLab Pages documentation](https://docs.gitlab.com/ee/user/project/pages/), everything happens with a `.gitlab-ci.yml` file placed in the root of your repository. This working example will get you started:
Typically, your static website will be hosted on https://yourUserName.gitlab.io/yourProjectName, so you will also want to create an initial `vue.config.js` file to [update the `BASE_URL`](https://github.com/vuejs/vue-cli/tree/dev/docs/config#baseurl) value to match:
// vue.config.js file to be place in the root of your repository
116
-
// make sure you update `yourProjectName` with the name of your GitLab project
115
+
// vue.config.js 位于仓库的根目录下
116
+
// 确保用 GitLab 项目的名称替换了 `YourProjectName`
117
117
118
118
module.exports = {
119
119
publicPath: process.env.NODE_ENV === 'production'
@@ -122,46 +122,46 @@ module.exports = {
122
122
}
123
123
```
124
124
125
-
Please read through the docs on [GitLab Pages domains](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html#gitlab-pages-domain) for more info about the URL where your project website will be hosted. Be aware you can also [use a custom domain](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_three.html#adding-your-custom-domain-to-gitlab-pages).
Commit both the `.gitlab-ci.yml`and`vue.config.js`files before pushing to your repository. AGitLab CIpipeline will be triggered: when successful, visit your project's `Settings > Pages` to see your website link, and click on it.
Create a new Firebase project on your [Firebase console](https://console.firebase.google.com). Please refer to this [documentation](https://firebase.google.com/docs/web/setup) on how to setup your project.
@@ -173,7 +173,7 @@ Firebase will ask some questions on how to setup your project.
173
173
}
174
174
```
175
175
176
-
-Select`yes`to configure your project as a single-page app. This will create an `index.html`and on your `dist`folder and configure your `hosting`information.
If you want to deploy publicly by default, you can change the deployment script to the following one:
241
+
如果想要将项目默认公开部署,部署脚本如下
242
242
243
243
```json
244
244
"deploy": "npm run build && now --public && now alias"
245
245
```
246
246
247
-
This will automatically point your site's alias to the latest deployment. Now, just run `npm run deploy`to deploy your app.
247
+
这将自动将站点的别名指向最新的部署。现在,只要运行 `npm run deploy` 就可以部署你的应用。
248
248
249
249
### Stdlib
250
250
@@ -256,15 +256,15 @@ Please refer to the [Firebase Documentation](https://firebase.google.com/docs/ho
256
256
257
257
### Surge
258
258
259
-
To deploy with[Surge](http://surge.sh/) the steps are very straightforward.
259
+
要使用 [Surge](http://surge.sh/) 进行部署,步骤非常简单。
260
260
261
-
First you would need to build your project by running `npm run build`. Andif you haven't installed Surge's command line tool, you can simply do so by running the command:
261
+
首先,通过运行 `npm run build` 来构建项目。如果还没有安装 Surge 的命令行工具,可以通过运行命令来执行此操作:
262
262
263
263
```
264
264
npm install --global surge
265
265
```
266
266
267
-
Then cd into the `dist/`folder of your project and then run `surge`and follow the screenprompt. It will ask you to set up email and password if it is the first time you are using Surge. Confirm the project folder and type in your preferred domain and watch your project being deployed such as below.
267
+
然后 cd 进入项目的 `dist/` 文件夹,然后运行 `surge` 并按照屏幕提示操作 。如果是第一次使用 Surge,它会要求设置电子邮件和密码。确认项目文件夹以及输入首选域来查看正在部署的项目,如下所示。
@@ -276,30 +276,30 @@ Then cd into the `dist/` folder of your project and then run `surge` and follow
276
276
Success! - Published to myawesomeproject.surge.sh
277
277
```
278
278
279
-
Verify your project is successfully published by Surge by visiting `myawesomeproject.surge.sh`, vola! For more setup details such as custom domains, you can visit [Surge's help page](https://surge.sh/help/).
279
+
通过访问 `myawesomeproject.surge.sh` 来确保你的项目已经成功的用 Surge 发布,有关自定义域名等更多设置详细信息,可以到 [Surge's help page](https://surge.sh/help/) 查看。
280
280
281
281
### Bitbucket Cloud
282
282
283
-
1. As described in the [Bitbucket documentation](https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html) you need to create a repository named exactly `<USERNAME>.bitbucket.io`.
2. It is possible to publish to a subfolder of the main repository, for instance if you want to have multiple websites. In that case set correct `publicPath` in `vue.config.js`.
If you are deploying to `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, set `publicPath` to `"/<SUBFOLDER>/"`. In this case the directory structure of the repository should reflect the url structure, for instance the repository should have a `/<SUBFOLDER>` directory.
0 commit comments