diff --git a/client/src/components/footer/index.tsx b/client/src/components/footer/index.tsx index db7a998..5978e8f 100644 --- a/client/src/components/footer/index.tsx +++ b/client/src/components/footer/index.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent } from "react"; import style from "./style.module.css"; +import { formatDate } from "../../util/date"; declare var __BUILD__: any; @@ -8,6 +9,7 @@ export interface FooterProps { } const Footer: FunctionComponent = ({ ...props}) => { + console.log(__BUILD__) return (
@@ -16,9 +18,8 @@ const Footer: FunctionComponent = ({ ...props}) => { Propulsé par Guesstimate et publié sous licence AGPL-3.0.

- Version: {__BUILD__.version} - - Réf.: {__BUILD__.gitRef ? __BUILD__.gitRef : '??'} - - Date de construction: {__BUILD__.buildDate ? __BUILD__.buildDate : '??'} + Réf.: {__BUILD__.gitRef ? __BUILD__.gitRef : '??'} | + Date de construction: {__BUILD__.buildDate ? formatDate(__BUILD__.buildDate) : '??'}

diff --git a/client/webpack.config.js b/client/webpack.config.js index 98e2bba..f41328c 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -11,6 +11,7 @@ module.exports = { entry: [ path.join(__dirname, './src/index.js') ], + devtool: env.NODE_ENV === 'production' ? 'source-map' : 'eval', output: { path: path.join(__dirname, 'dist'), filename: '[name].[hash].js', @@ -76,7 +77,6 @@ module.exports = { }), new webpack.DefinePlugin({ __BUILD__: JSON.stringify({ - version: getCurrentVersion(), gitRef: getCurrentGitRef(), buildDate: new Date(), }) @@ -84,14 +84,6 @@ module.exports = { ] }; -function getCurrentVersion() { - let version - try { - version = exec("git describe --always 2>/dev/null") - } catch(err) {} - return version ? version : "0.0.0"; -} - function getCurrentGitRef() { return exec("git log -n 1 --pretty='format:%h'").toString() } \ No newline at end of file