fix: use globalThis for client plugin

This commit is contained in:
Pooya Parsa 2021-02-19 15:11:13 +01:00
parent e1f409ea51
commit 709611941b

View File

@ -1,7 +1,8 @@
import _global from '@nuxt/un/runtime/global'
import { $fetch } from 'ohmyfetch'
global.process = global.process || {};
_global.process = _global.process || {};
(function () { const o = Date.now(); const t = () => Date.now() - o; global.process.hrtime = global.process.hrtime || ((o) => { const e = Math.floor(0.001 * (Date.now() - t())); const a = 0.001 * t(); let l = Math.floor(a) + e; let n = Math.floor(a % 1 * 1e9); return o && (l -= o[0], n -= o[1], n < 0 && (l--, n += 1e9)), [l, n] }) })()
(function () { const o = Date.now(); const t = () => Date.now() - o; _global.process.hrtime = _global.process.hrtime || ((o) => { const e = Math.floor(0.001 * (Date.now() - t())); const a = 0.001 * t(); let l = Math.floor(a) + e; let n = Math.floor(a % 1 * 1e9); return o && (l -= o[0], n -= o[1], n < 0 && (l--, n += 1e9)), [l, n] }) })()
global.$fetch = $fetch