Skip to content

Commit 2177900

Browse files
committed
fix: application version.
1 parent 4fc1ecd commit 2177900

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

config/env.js

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ function getClientEnvironment(publicUrl) {
8585
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
8686
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
8787
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
88+
89+
// Application version.
90+
VERSION: paths.appVersion
8891
}
8992
);
9093
// Stringify all values so we can feed into webpack DefinePlugin

config/paths.js

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const resolveModule = (resolveFn, filePath) => {
4848
return resolveFn(`${filePath}.js`);
4949
};
5050

51+
const appVersion = require(resolveApp('package.json')).version;
52+
5153
// config after eject: we're in ./config/
5254
module.exports = {
5355
dotenv: resolveApp('.env'),
@@ -65,6 +67,7 @@ module.exports = {
6567
proxySetup: resolveApp('src/setupProxy.js'),
6668
appNodeModules: resolveApp('node_modules'),
6769
publicUrlOrPath,
70+
appVersion
6871
};
6972

7073

src/components/Sidebar/Sidebar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function Sidebar({ dashboardContentRef }) {
2828
* @returns {React.JSX}
2929
*/
3030
function SidebarFooterVersion() {
31-
const { REACT_APP_VERSION: VERSION } = process.env;
31+
const { VERSION } = process.env;
3232

3333
if (!VERSION) {
3434
return null;

0 commit comments

Comments
 (0)