From 47c5b1e6a4da9af872c6e18a138cae1b20c622f3 Mon Sep 17 00:00:00 2001 From: Niklas Date: Sat, 25 Apr 2020 23:00:50 +0200 Subject: [PATCH] fixed git tag in webpack with drone --- webpack.config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 210184d..4411761 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,11 +10,15 @@ const path = require("path"); const DEVELOPMENT = process.env.NODE_ENV === "development"; -const version = require('child_process') - .execSync("git describe --abbrev=0") - .toString() - .replace("v", "") - .trim(); +let version = process.env.DRONE_TAG; + +if(!version){ + version = require('child_process') + .execSync("git describe --abbrev=0") + .toString(); +} + +version = version.replace("v", "").trim(); module.exports = { context: path.join(__dirname, "src"),