|
@@ -1,10 +1,16 @@
|
1
|
1
|
/* global __dirname */
|
2
|
2
|
|
|
3
|
+const { execSync } = require('child_process');
|
3
|
4
|
const path = require('path');
|
4
|
5
|
const process = require('process');
|
5
|
6
|
const { IgnorePlugin, ProvidePlugin } = require('webpack');
|
6
|
7
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
7
|
8
|
|
|
9
|
+const devNull = process.platform === 'win32' ? 'nul' : '/dev/null';
|
|
10
|
+const commitHash = process.env.LIB_JITSI_MEET_COMMIT_HASH
|
|
11
|
+ || execSync(`git rev-parse --short HEAD 2>${devNull} || echo development`)
|
|
12
|
+ .toString()
|
|
13
|
+ .trim();
|
8
|
14
|
|
9
|
15
|
module.exports = (minimize, analyzeBundle) => {
|
10
|
16
|
return {
|
|
@@ -24,8 +30,7 @@ module.exports = (minimize, analyzeBundle) => {
|
24
|
30
|
loader: 'string-replace-loader',
|
25
|
31
|
options: {
|
26
|
32
|
flags: 'g',
|
27
|
|
- replace:
|
28
|
|
- process.env.LIB_JITSI_MEET_COMMIT_HASH || 'development',
|
|
33
|
+ replace: commitHash,
|
29
|
34
|
search: '{#COMMIT_HASH#}'
|
30
|
35
|
},
|
31
|
36
|
test: path.join(__dirname, 'JitsiMeetJS.ts')
|