Skip to content

Commit d4b2de0

Browse files
committed
fix: try fix undefined approach
1 parent dde82b0 commit d4b2de0

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

config-overrides.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ module.exports = {
4848
}),
4949
);
5050

51-
// Add DefinePlugin to expose just the version
51+
// Add DefinePlugin to expose just the version as a global variable
5252
config.plugins.push(
5353
new webpack.DefinePlugin({
54-
'process.env.UI_VERSION': JSON.stringify(packageJson.version),
54+
__UI_VERSION__: JSON.stringify(packageJson.version),
5555
}),
5656
);
5757

src/containers/UserSettings/settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const autocompleteOnEnterSetting: SettingProps = {
141141
export const interfaceVersionInfoField: SettingsInfoFieldProps = {
142142
title: i18n('settings.about.interfaceVersionInfoField.title'),
143143
type: 'info',
144-
content: process.env.UI_VERSION,
144+
content: __UI_VERSION__,
145145
};
146146

147147
export const appearanceSection: SettingsSection = {

src/types/global.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
declare type AnyRecord = Record<string | number | symbol, unknown>;
2+
3+
declare const __UI_VERSION__: string;

0 commit comments

Comments
 (0)