mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix: use globalThis for client plugin
This commit is contained in:
parent
e1f409ea51
commit
709611941b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user