File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ You can also run the above script in your CI setup to enable automatic deploymen
66
66
67
67
2 . Create a file named ` .travis.yml ` in the root of your project.
68
68
69
- 3 . Run ` npm install ` locally and commit ` package-lock.json ` as it’s required for ` npm ci ` .
69
+ 3 . Run ` yarn ` or ` npm install ` locally and commit the generated lockfile (i.e. ` yarn.lock ` or ` package-lock.json ` ) .
70
70
71
71
4 . Use GitHub Pages deploy provider template and follow the [ travis documentation] ( https://docs.travis-ci.com/user/deployment/pages/ ) .
72
72
@@ -75,9 +75,9 @@ language: node_js
75
75
node_js :
76
76
- lts/*
77
77
install :
78
- - npm ci
78
+ - yarn install # npm ci
79
79
script :
80
- - npm run docs:build
80
+ - yarn docs:build # npm run docs:build
81
81
deploy :
82
82
provider : pages
83
83
skip_cleanup : true
@@ -109,8 +109,8 @@ pages:
109
109
- node_modules/
110
110
111
111
script:
112
- - npm install
113
- - npm run docs:build
112
+ - yarn install # npm install
113
+ - yarn docs:build # npm run docs:build
114
114
artifacts:
115
115
paths:
116
116
- public
@@ -123,7 +123,7 @@ pages:
123
123
124
124
1. On [Netlify](https://netlify.com), setup up a new project from GitHub with the following settings :
125
125
126
- - **Build Command:** `npm run docs:build` or `yarn docs:build`
126
+ - **Build Command:** `yarn docs:build` or `npm run docs:build`
127
127
- **Publish directory:** `docs/.vuepress/dist`
128
128
129
129
2. Hit the deploy button!
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ yarn add -D @vuepress/plugin-google-analytics
15
15
# OR npm install -D @vuepress/plugin-google-analytics
16
16
```
17
17
18
+ ::: warning
19
+ We currently recommend using [ Yarn] ( https://yarnpkg.com/en/ ) instead of npm to install all dependencies if you are using Google Analytics Plugin, because npm fails to generate the correct dependency tree in this case.
20
+ :::
21
+
18
22
## Usage
19
23
20
24
``` javascript
Original file line number Diff line number Diff line change 65
65
如果你打算发布到 ` https://<USERNAME or GROUP>.github.io/<REPO>/ ` (也就是说你的仓库在 ` https://github.com/<USERNAME>/<REPO> ` ),则将 ` base ` 设置为 ` "/<REPO>/" ` 。
66
66
67
67
2 . 在项目的根目录创建一个名为 ` .travis.yml ` 的文件;
68
- 3 . 在本地执行 ` npm install ` 并且在提交中包含 ` package- lock.json ` 因为 ` npm ci ` 需要它才能正确执行.
68
+ 3 . 在本地执行 ` yarn ` 或 ` npm install ` 并且提交生成的 lock 文件(即 ` yarn.lock ` 或 ` package-lock.json ` );
69
69
4 . 使用 GitHub Pages 部署提供程序模板并遵循 [ Travis 文档] ( https://docs.travis-ci.com/user/deployment/pages/ ) 。
70
70
71
71
``` yaml
72
72
language : node_js
73
73
node_js :
74
74
- lts/*
75
75
install :
76
- - npm ci
76
+ - yarn install # npm ci
77
77
script :
78
- - npm run docs:build
78
+ - yarn docs:build # npm run docs:build
79
79
deploy :
80
80
provider : pages
81
81
skip_cleanup : true
@@ -106,8 +106,8 @@ pages:
106
106
- node_modules/
107
107
108
108
script:
109
- - npm install
110
- - npm run docs:build
109
+ - yarn install # npm install
110
+ - yarn docs:build # npm run docs:build
111
111
artifacts:
112
112
paths:
113
113
- public
@@ -119,7 +119,7 @@ pages:
119
119
120
120
1. 在 Netlify 中, 创建一个新的 GitHub 项目,使用以下设置:
121
121
122
- - **Build Command:** `npm run build:docs` 或者 `yarn build:docs`
122
+ - **Build Command:** `yarn build:docs` 或者 `npm run build:docs`
123
123
- **Publish directory:** `docs/.vuepress/dist`
124
124
125
125
2. 点击 deploy 按钮!
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ yarn add -D @vuepress/plugin-google-analytics
14
14
# OR npm install -D @vuepress/plugin-google-analytics
15
15
```
16
16
17
+ ::: warning
18
+ 如果你的项目正在使用 Google analytics 插件,推荐使用 [ Yarn] ( https://yarnpkg.com/en/ ) 而不是 npm 来安装所有依赖。因为在这种情形下,npm 会生成错误的依赖树。
19
+ :::
20
+
17
21
## 使用
18
22
19
23
``` javascript
You can’t perform that action at this time.
0 commit comments