File size: 859 Bytes
4d70170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const isBrowser = typeof window !== 'undefined'

if (isBrowser) {
  require('./build/hook.js')
}
else {
  require('./build-node/hook.js')
}

const target = isBrowser
  ? window
  : typeof globalThis !== 'undefined'
    ? globalThis
    : {}

module.exports = {
  connect(host, port, { io, showToast, app } = {}) {
    target.__VUE_DEVTOOLS_HOST__ = host
    target.__VUE_DEVTOOLS_PORT__ = port
    if (io) {
      target.__VUE_DEVTOOLS_SOCKET__ = io
    }
    if (showToast) {
      target.__VUE_DEVTOOLS_TOAST__ = showToast
    }
    if (app) {
      target.__VUE_ROOT_INSTANCES__ = Array.isArray(app) ? app : [app]
    }

    if (isBrowser) {
      require('./build/backend.js')
    }
    else {
      require('./build-node/backend.js')
    }
  },
  init: (Vue) => {
    const tools = target.__VUE_DEVTOOLS_GLOBAL_HOOK__

    tools.emit('init', Vue)
  },
}