feat: Initial devtools support (#1125)
This commit is contained in:
16
packages/vue/src/dev.ts
Normal file
16
packages/vue/src/dev.ts
Normal 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.`
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user