mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add Git revision to build version
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user