1
0
mirror of synced 2025-12-19 17:17:05 -05:00

chore: properly replace version string

This commit is contained in:
caele
2021-09-14 08:31:39 +02:00
parent 39cacf167f
commit 047b248c01

21
nebula.config.js Normal file
View File

@@ -0,0 +1,21 @@
const path = require('path');
const crypto = require('crypto');
const { name, version } = require(path.resolve(__dirname, './package.json')); // eslint-disable-line
const versionHash = crypto
.createHash('md5')
.update(`${name}@${version}`)
.digest('hex')
.slice(0, 4);
const replacementStrings = {
'process.env.VERSION_HASH': JSON.stringify(versionHash),
'process.env.PACKAGE_VERSION': JSON.stringify(version),
};
module.exports = {
build: {
replacementStrings,
},
};