From 14ad04a8b2ecd9a82d80423e5dfa1a96ed725552 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 20 May 2022 13:00:06 +0800 Subject: [PATCH] feat: display version number #386 --- packages/app/client/.umirc.ts | 2 ++ packages/core/client/src/user/CurrentUser.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/app/client/.umirc.ts b/packages/app/client/.umirc.ts index 5e7c80700..76e581a61 100644 --- a/packages/app/client/.umirc.ts +++ b/packages/app/client/.umirc.ts @@ -1,6 +1,7 @@ import { getUmiConfig, resolveNocobasePackagesAlias } from '@nocobase/devtools/umiConfig'; import { defineConfig } from 'umi'; +const packageJson = require('./package.json'); const umiConfig = getUmiConfig(); process.env.MFSU_AD = 'none'; @@ -9,6 +10,7 @@ export default defineConfig({ hash: true, define: { 'process.env.APP_ENV': process.env.APP_ENV, + 'process.env.VERSION': packageJson?.devDependencies?.['@nocobase/client'], ...umiConfig.define, }, // only proxy when using `umi dev` diff --git a/packages/core/client/src/user/CurrentUser.tsx b/packages/core/client/src/user/CurrentUser.tsx index 10b6c2325..1566a6247 100644 --- a/packages/core/client/src/user/CurrentUser.tsx +++ b/packages/core/client/src/user/CurrentUser.tsx @@ -26,6 +26,8 @@ export const CurrentUser = () => { }} overlay={ + Version {process.env.VERSION} +