forked from vuejs/devtools-v6
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (29 loc) · 836 Bytes
/
index.js
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
const isBrowser = typeof window !== 'undefined'
if (isBrowser) {
require('./build/hook.js')
} else {
require('./build-node/hook.js')
}
const target = typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {}
module.exports = {
connect: function (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)
},
}