We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e55cb01 + 171f32a commit d6246d5Copy full SHA for d6246d5
packages/utils/src/constants.ts
@@ -1,3 +1,4 @@
1
+import process from 'node:process'
2
/**
3
* 一些地址信息
4
*/
@@ -29,3 +30,15 @@ export const OPEN_SOURCE_AUTHOR = {
29
30
githubVip: 'https://github.com/142vip',
31
gitee: 'https://gitee.com/chufan443',
32
}
33
+
34
+/**
35
+ * 用于区分base路径,是否nginx代理
36
+ * - 路径名称
37
+ * - 环境变量 NEED_PROXY
38
+ * @param baseName
39
+ */
40
+export function getDocSiteBase(baseName: string): '/' | `/${string}/` {
41
+ const needProxy = process.env.NEED_PROXY ?? false
42
43
+ return needProxy ? `/${baseName}/` : '/'
44
+}
0 commit comments