diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-29 02:58:41 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-29 02:58:41 +0800 |
commit | 5415d1589e922dc689eaa9ec64ab830f3fd46af4 (patch) | |
tree | e058cf6eb875ad40a347e5992087d0cdd191c192 /packages/instant | |
parent | 35d8525f5563e877752fd1bd9e5a5c7ffa395b78 (diff) | |
download | dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar.gz dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar.bz2 dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar.lz dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar.xz dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.tar.zst dexon-sol-tools-5415d1589e922dc689eaa9ec64ab830f3fd46af4.zip |
feat: write version info to window
Diffstat (limited to 'packages/instant')
-rw-r--r-- | packages/instant/src/index.umd.ts | 3 | ||||
-rw-r--r-- | packages/instant/src/util/version.ts | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts index 3a8694d6a..063874d36 100644 --- a/packages/instant/src/index.umd.ts +++ b/packages/instant/src/index.umd.ts @@ -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); diff --git a/packages/instant/src/util/version.ts b/packages/instant/src/util/version.ts new file mode 100644 index 000000000..5264cd659 --- /dev/null +++ b/packages/instant/src/util/version.ts @@ -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; + }, +}; |