File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/@vuepress/plugin-debug/src Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
- import type { Plugin } from '@vuepress/core'
1
+ import type { Plugin , PluginObject } from '@vuepress/core'
2
2
import { path } from '@vuepress/utils'
3
3
4
4
export type DebugPluginOptions = Record < never , never >
5
5
6
- export const debugPlugin : Plugin < DebugPluginOptions > = {
7
- name : '@vuepress/plugin-debug' ,
6
+ export const debugPlugin : Plugin < DebugPluginOptions > = ( _ , app ) => {
7
+ const pluginObj : PluginObject = {
8
+ name : '@vuepress/plugin-debug' ,
9
+ }
8
10
9
- clientAppRootComponentFiles : path . resolve ( __dirname , './components/Debug.js' ) ,
11
+ if ( app . env . isDev || app . env . isDebug ) {
12
+ pluginObj . clientAppRootComponentFiles = path . resolve (
13
+ __dirname ,
14
+ './components/Debug.js'
15
+ )
16
+ }
17
+
18
+ return pluginObj
10
19
}
11
20
12
21
export default debugPlugin
You can’t perform that action at this time.
0 commit comments