Add Git revision to build version

This commit is contained in:
Brian Vaughn
2019-04-11 18:44:44 -07:00
parent 3ea5fac959
commit 9a0cf68a4d
5 changed files with 42 additions and 40 deletions
+3 -14
View File
@@ -1,23 +1,12 @@
const { execSync } = require('child_process');
const { readFileSync } = require('fs');
const { resolve } = require('path');
const { DefinePlugin } = require('webpack');
const { getGitHubURL, getVersionString } = require('../utils');
const __DEV__ = process.env.NODE_ENV !== 'production';
// TODO potentially replac this with an fb.me URL (if it can forward the query params)
const GITHUB_URL = execSync('git remote get-url origin')
.toString()
.trim()
.replace(':', '/')
.replace('git@', 'https://')
.replace('.git', '');
const DEVTOOLS_VERSION = JSON.parse(
readFileSync(resolve(__dirname, '../../package.json'))
).version;
// TODO Share Webpack configs like alias
const GITHUB_URL = getGitHubURL();
const DEVTOOLS_VERSION = getVersionString();
module.exports = {
mode: 'development',