Skip to content
Snippets Groups Projects
Commit 2c65a4f3 authored by Thomas Roos's avatar Thomas Roos
Browse files

Use git hash as version

parent dfcb6cae
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ class NavBar extends React.Component {
<Link className="navbar-item" to='/graders'>Manage graders</Link>
<Link className="navbar-item has-text-info" to='/reset'>reset</Link>
<div className="navbar-item">
<i>Version 0.6.4</i>
<i>Version { __COMMIT_HASH__ }</i>
</div>
</div>
</div>
......
......@@ -2,6 +2,11 @@ const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
module.exports = merge(common, {
mode: 'development',
module: {
......@@ -29,6 +34,9 @@ module.exports = merge(common, {
plugins: [
new webpack.EvalSourceMapDevToolPlugin({
sourceURLTemplate: module => `/${module.identifier}`
}),
new webpack.DefinePlugin({
__COMMIT_HASH__: JSON.stringify(commitHash + '-dev'),
})
]
})
\ No newline at end of file
......@@ -5,6 +5,11 @@ const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
module.exports = merge(common, {
mode: 'production',
......@@ -36,6 +41,9 @@ module.exports = merge(common, {
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
}),
new webpack.DefinePlugin({
__COMMIT_HASH__: JSON.stringify(commitHash + '-prod'),
})
]
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment