feat: write version info to window

This commit is contained in:
fragosti
2018-11-28 10:58:41 -08:00
parent 35d8525f55
commit 5415d1589e
2 changed files with 11 additions and 0 deletions

View File

@@ -6,6 +6,9 @@ import { DEFAULT_ZERO_EX_CONTAINER_SELECTOR, INJECTED_DIV_CLASS, INJECTED_DIV_ID
import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index';
import { assert } from './util/assert';
import { util } from './util/util';
import { versionUtil } from './util/version';
versionUtil.writeVersionInfoToWindow();
const isInstantRendered = (): boolean => !!document.getElementById(INJECTED_DIV_ID);

View File

@@ -0,0 +1,8 @@
const anyWindow = window as any;
export const versionUtil = {
writeVersionInfoToWindow: () => {
anyWindow.__zeroExInstantGitSha = process.env.GIT_SHA;
anyWindow.__zeroExInstantNpmVersion = process.env.NPM_PACKAGE_VERSION;
},
};