From 600d267bf3096ca2e63e33a3b3ec69f1014fdd84 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Fri, 20 Nov 2020 16:20:57 +0100 Subject: [PATCH] web: We no longer need git dependency in webpack builds - fixes #1517 --- web/packages/demo/webpack.config.js | 16 ---------------- web/packages/extension/webpack.config.js | 16 ---------------- web/packages/selfhosted/webpack.config.js | 16 ---------------- 3 files changed, 48 deletions(-) diff --git a/web/packages/demo/webpack.config.js b/web/packages/demo/webpack.config.js index e1a2a38b9..245d293a9 100644 --- a/web/packages/demo/webpack.config.js +++ b/web/packages/demo/webpack.config.js @@ -2,7 +2,6 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); -const webpack = require("webpack"); const path = require("path"); module.exports = (env, argv) => { @@ -11,16 +10,6 @@ module.exports = (env, argv) => { mode = argv.mode; } - const commitHash = require("child_process") - .execSync("git rev-parse --short HEAD") - .toString(); - - const commitDate = require("child_process") - .execSync("git log -1 --date=short --pretty=format:%cd") - .toString(); - - const channel = process.env.CFG_RELEASE_CHANNEL || "nightly".toLowerCase(); - console.log(`Building ${mode}...`); return { @@ -37,11 +26,6 @@ module.exports = (env, argv) => { devtool: "source-map", plugins: [ new CleanWebpackPlugin(), - new webpack.DefinePlugin({ - __COMMIT_HASH__: JSON.stringify(commitHash), - __COMMIT_DATE__: JSON.stringify(commitDate), - __CHANNEL__: JSON.stringify(channel), - }), new CopyWebpackPlugin({ patterns: [ { diff --git a/web/packages/extension/webpack.config.js b/web/packages/extension/webpack.config.js index c443a3998..81f2065af 100644 --- a/web/packages/extension/webpack.config.js +++ b/web/packages/extension/webpack.config.js @@ -2,7 +2,6 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); -const webpack = require("webpack"); const path = require("path"); module.exports = (env, argv) => { @@ -11,16 +10,6 @@ module.exports = (env, argv) => { mode = argv.mode; } - const commitHash = require("child_process") - .execSync("git rev-parse --short HEAD") - .toString(); - - const commitDate = require("child_process") - .execSync("git log -1 --date=short --pretty=format:%cd") - .toString(); - - const channel = process.env.CFG_RELEASE_CHANNEL || "nightly".toLowerCase(); - console.log(`Building ${mode}...`); return { @@ -42,11 +31,6 @@ module.exports = (env, argv) => { }, plugins: [ new CleanWebpackPlugin(), - new webpack.DefinePlugin({ - __COMMIT_HASH__: JSON.stringify(commitHash), - __COMMIT_DATE__: JSON.stringify(commitDate), - __CHANNEL__: JSON.stringify(channel), - }), new CopyPlugin({ patterns: [{ from: "LICENSE*" }, { from: "README.md" }], }), diff --git a/web/packages/selfhosted/webpack.config.js b/web/packages/selfhosted/webpack.config.js index 68fa007e8..c687f4425 100644 --- a/web/packages/selfhosted/webpack.config.js +++ b/web/packages/selfhosted/webpack.config.js @@ -2,7 +2,6 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); -const webpack = require("webpack"); const path = require("path"); module.exports = (env, argv) => { @@ -11,16 +10,6 @@ module.exports = (env, argv) => { mode = argv.mode; } - const commitHash = require("child_process") - .execSync("git rev-parse --short HEAD") - .toString(); - - const commitDate = require("child_process") - .execSync("git log -1 --date=short --pretty=format:%cd") - .toString(); - - const channel = process.env.CFG_RELEASE_CHANNEL || "nightly".toLowerCase(); - console.log(`Building ${mode}...`); return { @@ -38,11 +27,6 @@ module.exports = (env, argv) => { devtool: "source-map", plugins: [ new CleanWebpackPlugin(), - new webpack.DefinePlugin({ - __COMMIT_HASH__: JSON.stringify(commitHash), - __COMMIT_DATE__: JSON.stringify(commitDate), - __CHANNEL__: JSON.stringify(channel), - }), new CopyPlugin({ patterns: [{ from: "LICENSE*" }, { from: "README.md" }], }),