Skip to content

Commit 372f62d

Browse files
committed
ref(vuebugger): extract plugin into file
1 parent 14c09d9 commit 372f62d

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

packages/vuebugger/src/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
import type { App, Plugin } from 'vue'
2-
import { setUidGenerator } from './debug'
3-
import { setupComposableDevtools } from './devtools'
4-
import { PluginOptions } from './types'
1+
import { plugin } from './plugin'
52

63
export { debug } from './debug'
74

8-
const plugin: Plugin<[PluginOptions?]> = {
9-
install: (app: App, options?: PluginOptions) => {
10-
if (!import.meta.env?.DEV) return
11-
if (options?.uidFn) setUidGenerator(options.uidFn)
12-
setupComposableDevtools(app)
13-
},
14-
}
15-
16-
export { plugin as DebugPlugin }
5+
export { plugin as DebugPlugin, plugin as Vuebugger }
176
export default plugin

packages/vuebugger/src/plugin.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { App, Plugin } from 'vue'
2+
import { setUidGenerator } from './debug'
3+
import { setupComposableDevtools } from './devtools'
4+
import type { PluginOptions } from './types'
5+
6+
export const plugin: Plugin<[PluginOptions?]> = {
7+
install: (app: App, options?: PluginOptions) => {
8+
if (!import.meta.env?.DEV) return
9+
if (options?.uidFn) setUidGenerator(options.uidFn)
10+
setupComposableDevtools(app)
11+
},
12+
}

0 commit comments

Comments
 (0)