docs: merge branch 'docs' into dev [ci skip]

This commit is contained in:
Haoqun Jiang
2018-09-05 14:12:47 +08:00
9 changed files with 77 additions and 8 deletions

View File

@@ -17,6 +17,9 @@ module.exports = {
}
},
serviceWorker: true,
head: [
['link', { rel: 'icon', href: '/favicon.png' }],
],
theme: 'vue',
themeConfig: {
repo: 'vuejs/vue-cli',

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,6 +1,6 @@
---
home: true
heroImage: /logo.png
heroImage: /favicon.png
actionText: Get Started →
actionLink: /guide/
footer: MIT Licensed | Copyright © 2018-present Evan You

View File

@@ -58,10 +58,10 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser
set -e
# build
npm run docs:build
npm run build
# navigate into the build output directory
cd docs/.vuepress/dist
cd dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
@@ -273,3 +273,36 @@ Then cd into the `dist/` folder of your project and then run `surge` and follow
```
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/).
### Bitbucket Cloud
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 `baseUrl` in `vue.config.js`.
If you are deploying to `https://<USERNAME>.bitbucket.io/`, you can omit `baseUrl` as it defaults to `"/"`.
If you are deploying to `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, set `baseUrl` 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.
3. Inside your project, create `deploy.sh` with the following content and run it to deploy:
``` bash{13,20,23}
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
git init
git add -A
git commit -m 'deploy'
git push -f git@bitbucket.org:<USERNAME>/<USERNAME>.bitbucket.io.git master
cd -
```

View File

@@ -123,7 +123,7 @@ module.exports = {
}
```
You will need to familiarize yourself with [webpack-chain's API](https://github.com/mozilla-neutrino/webpack-chain#getting-started) and [read some source code](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config) in order to understand how to leverage the full power of this option, but it gives you a more expressive and safer way to modify the webpack config than directly mutation values.
You will need to familiarize yourself with [webpack-chain's API](https://github.com/mozilla-neutrino/webpack-chain#getting-started) and [read some source code](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config) in order to understand how to leverage the full power of this option, but it gives you a more expressive and safer way to modify the webpack config than directly mutate values.
For example, say you want to change the default location of `index.html` from `/Users/username/proj/public/index.html` to `/Users/username/proj/app/templates/index.html`. By referencing [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin#options) you can see a list of options you can pass in. To change our template path we can pass in a new template path with the following config:
@@ -182,7 +182,7 @@ vue inspect --plugins
## Using Resolved Config as a File
Some external tools may need access to the resolved webpack config as a file, for example IDEs or command line tools that expects a webpack config path. In that case you can use the following path:
Some external tools may need access to the resolved webpack config as a file, for example IDEs or command line tools that expect a webpack config path. In that case you can use the following path:
```
<projectRoot>/node_modules/@vue/cli-service/webpack.config.js

View File

@@ -1,6 +1,6 @@
---
home: true
heroImage: /logo.png
heroImage: /favicon.png
actionText: Введение →
actionLink: /ru/guide/
footer: MIT Licensed | Copyright © 2018-present Evan You

View File

@@ -8,7 +8,7 @@
- `index.html` с внедрением ресурсов и подсказок для пред-загрузки
- сторонние библиотеки разделяются на отдельные фрагменты для лучшего кэширования
- статические ресурсы менее 10КБайт будут вставлены инлайн в JavaScript
- статические ресурсы менее 4 КБайт будут вставлены инлайн в JavaScript
- статические ресурсы в `public` будут скопированы в каталог сборки
## Библиотека (Library)

View File

@@ -273,3 +273,36 @@ npm install --global surge
```
Убедитесь, что ваш проект успешно опубликован с помощью Surge открыв в браузере `myawesomeproject.surge.sh`! Дополнительные сведения о настройке, такие как конфигурация пользовательских доменов, можно найти на [странице справки Surge](https://surge.sh/help/).
### Bitbucket Cloud
1. Как описывается в [документации Bitbucket](https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html) вам необходимо создать репозиторий названный в точности `<USERNAME>.bitbucket.io`.
2. Возможно публиковать в подкаталог, например, если требуется иметь несколько веб-сайтов. В этом случае укажите корректный `baseUrl` в файле `vue.config.js`.
Если публикуете по адресу `https://<USERNAME>.bitbucket.io/`, установку `baseUrl` можно опустить, поскольку значение по умолчанию `"/"`.
Если публикуете по адресу `https://<USERNAME>.bitbucket.io/<SUBFOLDER>/`, нужно задать `baseUrl` в значение `"/<SUBFOLDER>/"`. В этом случае структура каталогов должна отражать структуру URL-адресов, например, репозиторий должен иметь каталог `/<SUBFOLDER>`.
3. В проекте создайте `deploy.sh` с указанным содержимым и запустите его для публикации:
``` bash{13,20,23}
#!/usr/bin/env sh
# остановиться при ошибках
set -e
# сборка
npm run build
# переход в каталог итоговой сборки
cd dist
git init
git add -A
git commit -m 'deploy'
git push -f git@bitbucket.org:<USERNAME>/<USERNAME>.bitbucket.io.git master
cd -
```

View File

@@ -1,6 +1,6 @@
---
home: true
heroImage: /logo.png
heroImage: /favicon.png
actionText: 起步 →
actionLink: /zh/guide/
features: