Skip to content

Commit

Permalink
Merge pull request #3471 from alibaba/docs-define-config
Browse files Browse the repository at this point in the history
docs: add define config
  • Loading branch information
chenbin92 authored Aug 22, 2020
2 parents 80f5f59 + 05d256b commit 770e7a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- uses: nelonoel/branch-name@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -18,8 +19,10 @@ jobs:
- run: npm run dependency:check
- run: npm run lint
- run: npm run test
- run: npm run coverage
- run: npm run generate:docs
- run: npm run upload:oss
- run: npm run coverage
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
CI: true
15 changes: 15 additions & 0 deletions docs/guide/basic/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,21 @@ icejs 中一般不允许修改该配置。

注意,devServer 不支持 port 属性配置,如需改变端口,请通过命令行参数传入。

### define

- 类型: `object`
- 默认值: `{}`

配置全局变量。

```json
{
"define": {
"ASSER_VERSION": "0.1.0"
}
}
```

### browserslist

- 类型: `string` | `object` 
Expand Down
4 changes: 2 additions & 2 deletions scripts/upload-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const glob = require('glob');
const bucket = 'iceworks';
const accessKeyId = process.env.ACCESS_KEY_ID;
const accessKeySecret = process.env.ACCESS_KEY_SECRET;
const branch = process.env.TRAVIS_BRANCH;
const branch = process.env.BRANCH_NAME;
const assetsPath = branch === 'master' ? 'assets' : 'pre-assets';

if (branch === 'master' || /docs/.test(branch)) {
Expand Down Expand Up @@ -43,6 +43,6 @@ if (branch === 'master' || /docs/.test(branch)) {
});
} else {
console.log('当前分支非 master/docs*, 不执行文档同步脚本');
console.log(`TRAVIS_BRANCH=${branch}`);
console.log(`BRANCH_NAME=${branch}`);
process.exit(0);
}

0 comments on commit 770e7a8

Please sign in to comment.