mirror of
https://github.com/nickzuber/meteorite.git
synced 2024-11-29 09:31:15 +03:00
Version bump and sync git hash
This commit is contained in:
parent
7ad93df2bd
commit
b27c4bc962
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const {execSync} = require('child_process');
|
||||||
const PnpWebpackPlugin = require('pnp-webpack-plugin');
|
const PnpWebpackPlugin = require('pnp-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
||||||
@ -14,6 +15,7 @@ const paths = require('./paths');
|
|||||||
const ManifestPlugin = require('webpack-manifest-plugin');
|
const ManifestPlugin = require('webpack-manifest-plugin');
|
||||||
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
|
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
|
||||||
|
|
||||||
|
const gitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
||||||
|
|
||||||
// Webpack uses `publicPath` to determine where the app is being served from.
|
// Webpack uses `publicPath` to determine where the app is being served from.
|
||||||
// In development, we always serve from the root. This makes config easier.
|
// In development, we always serve from the root. This makes config easier.
|
||||||
@ -327,6 +329,11 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
'GIT_HASH': JSON.stringify(gitHash)
|
||||||
|
}
|
||||||
|
}),
|
||||||
// Generates an `index.html` file with the <script> injected.
|
// Generates an `index.html` file with the <script> injected.
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: true,
|
inject: true,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const {execSync} = require('child_process');
|
||||||
const PnpWebpackPlugin = require('pnp-webpack-plugin');
|
const PnpWebpackPlugin = require('pnp-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
|
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
|
||||||
@ -18,6 +19,8 @@ const paths = require('./paths');
|
|||||||
const getClientEnvironment = require('./env');
|
const getClientEnvironment = require('./env');
|
||||||
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
|
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
|
||||||
|
|
||||||
|
const gitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
||||||
|
|
||||||
|
|
||||||
// Webpack uses `publicPath` to determine where the app is being served from.
|
// Webpack uses `publicPath` to determine where the app is being served from.
|
||||||
// It requires a trailing slash, or the file assets will get an incorrect path.
|
// It requires a trailing slash, or the file assets will get an incorrect path.
|
||||||
@ -416,6 +419,11 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
'GIT_HASH': JSON.stringify(gitHash)
|
||||||
|
}
|
||||||
|
}),
|
||||||
// Generates an `index.html` file with the <script> injected.
|
// Generates an `index.html` file with the <script> injected.
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: true,
|
inject: true,
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meteorite",
|
"name": "meteorite",
|
||||||
"version": "0.1.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -8,7 +8,8 @@ import Logo from '../../components/Logo';
|
|||||||
import screenshot from '../../images/screenshot.png';
|
import screenshot from '../../images/screenshot.png';
|
||||||
import '../../styles/gradient.css';
|
import '../../styles/gradient.css';
|
||||||
|
|
||||||
const version = require('../../../package.json').version;
|
const hash = process.env.GIT_HASH ? `#${process.env.GIT_HASH}` : '';
|
||||||
|
const version = require('../../../package.json').version + hash;
|
||||||
|
|
||||||
function createImagePlaceholder (highlight) {
|
function createImagePlaceholder (highlight) {
|
||||||
return (
|
return (
|
||||||
@ -749,9 +750,9 @@ export default function Scene ({loggedIn, onLogout, ...props}) {
|
|||||||
</SmallText>
|
</SmallText>
|
||||||
</Item>
|
</Item>
|
||||||
<Item style={{textAlign: 'right'}} className="footer-links">
|
<Item style={{textAlign: 'right'}} className="footer-links">
|
||||||
<SmallLink style={{marginLeft: 28}}>Source code</SmallLink>
|
<SmallLink target="_blank" href="https://github.com/nickzuber/meteorite/" style={{marginLeft: 28}}>Source code</SmallLink>
|
||||||
<SmallLink style={{marginLeft: 28}}>Bug reports</SmallLink>
|
<SmallLink target="_blank" href="https://github.com/nickzuber/meteorite/issues" style={{marginLeft: 28}}>Bug reports</SmallLink>
|
||||||
<SmallLink style={{marginLeft: 28}}>Submit feedback</SmallLink>
|
<SmallLink target="_blank" href="https://github.com/nickzuber/meteorite/issues" style={{marginLeft: 28}}>Submit feedback</SmallLink>
|
||||||
<SmallText style={{marginLeft: 28, opacity: .25}}>v{version}</SmallText>
|
<SmallText style={{marginLeft: 28, opacity: .25}}>v{version}</SmallText>
|
||||||
</Item>
|
</Item>
|
||||||
<Item style={{flex: '0 0 2.5%', padding: 0}} />
|
<Item style={{flex: '0 0 2.5%', padding: 0}} />
|
||||||
|
Loading…
Reference in New Issue
Block a user