mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 09:42:53 +02:00
Fix #1880: Show git commit of bundled app
This commit is contained in:
@@ -42,6 +42,13 @@ module.exports = (env, argv) => {
|
||||
};
|
||||
}
|
||||
|
||||
// Get the current commit hash to inject into the app
|
||||
// https://stackoverflow.com/a/38401256
|
||||
const commitHash = require('child_process')
|
||||
.execSync('git rev-parse --short HEAD')
|
||||
.toString()
|
||||
.trim();
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
@@ -105,6 +112,9 @@ module.exports = (env, argv) => {
|
||||
},
|
||||
},
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
__COMMIT_HASH__: JSON.stringify(commitHash)
|
||||
}),
|
||||
// In dev mode, use a faster method of create sourcemaps
|
||||
// while keeping lines/columns accurate
|
||||
isDevServer &&
|
||||
|
||||
Reference in New Issue
Block a user