diff --git a/nebula.config.js b/nebula.config.js new file mode 100644 index 0000000..51aa09c --- /dev/null +++ b/nebula.config.js @@ -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, + }, +};