From 7da4043560683b0c8526479acf425f6842df2f82 Mon Sep 17 00:00:00 2001 From: Muzzle886 <2568682437@qq.com> Date: Wed, 14 Aug 2024 17:40:43 +0800 Subject: [PATCH] docs: missing basePath --- .dumirc.ts | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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",