Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e2f80bc

Browse files
author
zhiwen.zhao
committed
feat: 使用 github pages 部署文档站点
1 parent 79f61c3 commit e2f80bc

File tree

4 files changed

+417
-44
lines changed

4 files changed

+417
-44
lines changed

‎.umirc.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
import { defineConfig } from 'dumi';
22

3+
// 此处更换为自己的仓库名
4+
let base = '/react-ui-library-tutorial';
5+
let publicPath = '/react-ui-library-tutorial/';
6+
7+
if (process.env.DOC_BUILD_ENV === 'local') {
8+
base = undefined;
9+
publicPath = undefined;
10+
}
11+
312
export default defineConfig({
413
title: 'Happy UI',
514
mode: 'site',
615
outputPath: 'doc-site',
716
exportStatic: {},
817
dynamicImport: {},
18+
base,
19+
publicPath,
920
});

‎now.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"scripts": {
1414
"dev": "dumi dev",
1515
"start": "npm run dev",
16-
"build:doc": "rimraf doc-site && dumi build",
16+
"build:site": "rimraf doc-site && dumi build",
17+
"preview:site": "cross-env DOC_BUILD_ENV=local npm run build:site && serve doc-site",
18+
"deploy:site": "npm run build:site && gh-pages -d doc-site",
1719
"clean": "rimraf lib esm dist",
1820
"build:types": "tsc -p tsconfig.build.json && cpr lib esm",
1921
"build": "npm run clean && npm run build:types && gulp",
20-
"publish:doc": "now --prod",
21-
"now-build": "npm run build:doc",
2222
"commit": "git-cz",
2323
"test": "jest",
2424
"test:watch": "jest --watch",
@@ -84,9 +84,11 @@
8484
"babel-plugin-import": "^1.13.3",
8585
"commitizen": "^4.0.3",
8686
"cpr": "^3.0.1",
87+
"cross-env": "^7.0.3",
8788
"cz-conventional-changelog": "^3.0.2",
8889
"doctoc": "^1.4.0",
8990
"dumi": "^1.0.13",
91+
"gh-pages": "^3.2.3",
9092
"gulp": "^4.0.2",
9193
"gulp-autoprefixer": "^7.0.1",
9294
"gulp-babel": "^8.0.0",
@@ -97,12 +99,12 @@
9799
"jest": "^24.9.0",
98100
"less": "^3.10.3",
99101
"lint-staged": "^9.5.0",
100-
"now": "^19.0.1",
101102
"plop": "^2.6.0",
102103
"prettier": "^1.19.1",
103104
"react": "^16.8.0",
104105
"react-dom": "^16.8.0",
105106
"rimraf": "^3.0.0",
107+
"serve": "^12.0.0",
106108
"snapshot-diff": "^0.6.1",
107109
"through2": "^3.0.1",
108110
"ts-jest": "^24.2.0",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /