diff --git a/.dumirc.ts b/.dumirc.ts index a0e7004..498e3b6 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,5 +1,8 @@ import { defineConfig } from 'dumi'; +const basePath = process.env.GH_PAGES ? '/input/' : '/'; +const publicPath = process.env.GH_PAGES ? '/input/' : '/'; + export default defineConfig({ mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], @@ -8,4 +11,6 @@ export default defineConfig({ logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, outputPath: '.doc', + base: basePath, + publicPath, }); diff --git a/package.json b/package.json index c3d6f65..f847dde 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "docs:build": "dumi build", "docs:deploy": "gh-pages -d .doc", "compile": "father build && lessc assets/index.less assets/index.css", - "gh-pages": "npm run docs:build && npm run docs:deploy", + "gh-pages": "GH_PAGES=1 npm run docs:build && npm run docs:deploy", "prepublishOnly": "npm run compile && np --yolo --no-publish", "postpublish": "npm run gh-pages", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",