feat: Initial devtools support (#1125)

This commit is contained in:
Guillaume Chau
2020-07-17 00:18:52 +02:00
committed by GitHub
parent 5ed73cd874
commit 568b6db12b
15 changed files with 132 additions and 17 deletions

16
packages/vue/src/dev.ts Normal file
View File

@@ -0,0 +1,16 @@
import { version, setDevtoolsHook } from '@vue/runtime-dom'
export function initDev() {
const target: any = __BROWSER__ ? window : global
target.__VUE__ = version
setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__)
if (__BROWSER__) {
// @ts-ignore `console.info` cannot be null error
console[console.info ? 'info' : 'log'](
`You are running a development build of Vue.\n` +
`Make sure to use the production build (*.prod.js) when deploying for production.`
)
}
}