chore: Remove env variables in webpack bundle (#1353)

* chore: Remove env variables in webpack bundle

* remove unused globals

* refactor: consolidate window.env calls to single file

* fix: Slack client side integration auth

* fix: developers url
This commit is contained in:
Tom Moor
2020-07-18 11:02:40 -07:00
committed by GitHub
parent 24448c7504
commit 67981a351e
32 changed files with 186 additions and 206 deletions

View File

@@ -10,9 +10,10 @@ import ScrollToTop from "components/ScrollToTop";
import Toasts from "components/Toasts";
import Theme from "components/Theme";
import Routes from "./routes";
import env from "env";
let DevTools;
if (__DEV__) {
if (process.env.NODE_ENV !== "production") {
DevTools = require("mobx-react-devtools").default; // eslint-disable-line global-require
}
@@ -44,7 +45,7 @@ if (element) {
window.addEventListener("load", async () => {
// installation does not use Google Analytics, or tracking is blocked on client
// no point loading the rest of the analytics bundles
if (!process.env.GOOGLE_ANALYTICS_ID || !window.ga) return;
if (!env.GOOGLE_ANALYTICS_ID || !window.ga) return;
// https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099
await import("autotrack/autotrack.js");