Inject frontend version as environment variable

This commit is contained in:
D. Berge
2025-07-25 23:14:30 +02:00
parent 9b05388113
commit 08e65b512d

View File

@@ -1,4 +1,7 @@
const webpack = require('webpack');
const { execSync } = require('child_process');
const gitDescribe = execSync('git describe --tags --always', { encoding: 'utf8' }).trim();
module.exports = {
"transpileDependencies": [
@@ -48,7 +51,11 @@ module.exports = {
// https://github.com/webpack/changelog-v5/issues/10
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
})
}),
new webpack.DefinePlugin({
'process.env.DOUGAL_FRONTEND_VERSION': JSON.stringify(gitDescribe),
}),
],
module: {
rules: [