From 6e5c7bf308ddcb2be756cb84c6c7119b612e4e28 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 10 Sep 2023 08:22:28 +0200 Subject: Use export-subst gitattribute to allow tarball builds For example it would do the following: let subst = "d3bf557c"; --- build/webpack.prod.conf.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'build') diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 7de93721..664290a5 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -11,9 +11,16 @@ var env = process.env.NODE_ENV === 'testing' ? require('../config/test.env') : config.build.env -let commitHash = require('child_process') - .execSync('git rev-parse --short HEAD') - .toString(); +let commitHash = (() => { + let subst = "$Format:%h$"; + if(!subst.match(/Format:/)) { + return subst; + } else { + return require('child_process') + .execSync('git rev-parse --short HEAD') + .toString(); + } +})(); var webpackConfig = merge(baseWebpackConfig, { mode: 'production', -- cgit v1.2.3-70-g09d2