From 85b489b3a78682d5430a45d2802d556d2df717f0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 Oct 2021 08:16:04 -0600 Subject: [PATCH] Artificially set a VERSION environment variable during build steps (#19518) Fixes https://github.com/vector-im/element-web/issues/19485 The variable should be set when it needs to by CI, but in every other environment it's not important. Simply setting it to *something* makes EnvironmentPlugin happy. We print a warning just in case people expect it to be set, and use a clear value in case the environment variable doesn't get properly set. --- webpack.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 97772ea0c9..6b40a100ca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,6 +15,11 @@ dotenv.config(); let ogImageUrl = process.env.RIOT_OG_IMAGE_URL; if (!ogImageUrl) ogImageUrl = 'https://app.element.io/themes/element/img/logos/opengraph.png'; +if (!process.env.VERSION) { + console.warn("Unset VERSION variable - this may affect build output"); + process.env.VERSION = "!!UNSET!!"; +} + const cssThemes = { // CSS themes "theme-legacy-light": "./node_modules/matrix-react-sdk/res/themes/legacy-light/css/legacy-light.scss",