File tree Expand file tree Collapse file tree 6 files changed +12
-21
lines changed Expand file tree Collapse file tree 6 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,9 @@ interface VitePluginInspectorOptions {
122
122
* examples: control-shift, control-o, control-alt-s meta-x control-meta
123
123
* Some keys have native behavior (e.g. alt-s opens history menu on firefox).
124
124
* To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended.
125
+ * You can also disable it by setting `false`.
125
126
*/
126
- toggleComboKey? : string
127
+ toggleComboKey? : string | false
127
128
128
129
/**
129
130
* Toggle button visibility
Original file line number Diff line number Diff line change 15
15
"play:vue3" : " pnpm run -r --filter=./packages/playground/vue3 dev" ,
16
16
"play:vue2" : " pnpm run -r --filter=./packages/playground/vue2 dev" ,
17
17
"lint" : " eslint --fix --ext .js,.ts,.vue ." ,
18
- "stub " : " pnpm run -r --filter=./packages/core stub " ,
18
+ "dev " : " pnpm run -r --filter=./packages/core dev " ,
19
19
"build" : " pnpm run -r --filter=./packages/{core,unplugin} build" ,
20
20
"release" : " pnpm build && changeset && changeset version && changeset publish"
21
21
},
28
28
"tsup" : " ^5.12.1" ,
29
29
"tsx" : " ^3.12.2" ,
30
30
"typescript" : " ^4.9.4" ,
31
- "unbuild" : " ^1.1.1" ,
32
31
"vite" : " ^4.0.3" ,
33
32
"vue" : " ^3.2.45"
34
33
},
Original file line number Diff line number Diff line change 38
38
],
39
39
"scripts" : {
40
40
"lint" : " eslint --fix --ext .js,.ts,.vue ." ,
41
- "stub " : " unbuild " ,
41
+ "dev " : " tsup --watch " ,
42
42
"build" : " tsup"
43
43
},
44
44
"peerDependencies" : {
58
58
"devDependencies" : {
59
59
"@types/babel__core" : " ^7.1.20" ,
60
60
"unplugin" : " ^1.0.1"
61
- },
62
- "unbuild" : {
63
- "entries" : [
64
- " ./src/index"
65
- ],
66
- "clean" : true ,
67
- "declaration" : true ,
68
- "rollup" : {
69
- "emitCJS" : true
70
- }
71
61
}
72
62
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export default {
18
18
containerRef: null ,
19
19
floatsRef: null ,
20
20
enabled: inspectorOptions .enabled ,
21
- toggleCombo: inspectorOptions .toggleComboKey ? .toLowerCase () .split (' -' ),
21
+ toggleCombo: inspectorOptions .toggleComboKey ? .toLowerCase ? .() ? .split ? . (' -' ) ?? false ,
22
22
overlayVisible: false ,
23
23
position: {
24
24
x: 0 ,
Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ export interface VitePluginInspectorOptions {
47
47
* examples: control-shift, control-o, control-alt-s meta-x control-meta
48
48
* Some keys have native behavior (e.g. alt-s opens history menu on firefox).
49
49
* To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended.
50
+ * You can also disable it by setting `false`.
50
51
*/
51
- toggleComboKey ?: string
52
+ toggleComboKey ?: string | false
52
53
53
54
/**
54
55
* Toggle button visibility
@@ -149,13 +150,13 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
149
150
} ,
150
151
configureServer ( server ) {
151
152
const _printUrls = server . printUrls
153
+ const { toggleComboKey } = normalizedOptions
152
154
153
- server . printUrls = ( ) => {
154
- const { toggleComboKey } = normalizedOptions
155
+ toggleComboKey && ( server . printUrls = ( ) => {
155
156
const keys = normalizeComboKeyPrint ( toggleComboKey )
156
157
_printUrls ( )
157
158
console . log ( ` ${ green ( '➜' ) } ${ bold ( 'Vue Inspector' ) } : ${ green ( `Press ${ yellow ( keys ) } in App to toggle the Inspector` ) } \n` )
158
- }
159
+ } )
159
160
} ,
160
161
transformIndexHtml ( html ) {
161
162
if ( normalizedOptions . appendTo )
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ export default (options: Options, nuxt: any) => {
13
13
} )
14
14
let printed = false
15
15
nuxt . hook ( 'vite:serverCreated' , ( ) => {
16
- if ( printed )
17
- return
18
16
const normalizedOptions = { ...DEFAULT_INSPECTOR_OPTIONS , ...options }
19
17
const { toggleComboKey } = normalizedOptions
18
+ if ( printed || ! toggleComboKey )
19
+ return
20
20
const keys = normalizeComboKeyPrint ( toggleComboKey )
21
21
console . log ( ` ${ '> Vue Inspector' } : ${ green ( `Press ${ yellow ( keys ) } in App to toggle the Inspector` ) } \n` )
22
22
printed = true
You can’t perform that action at this time.
0 commit comments