@@ -19,15 +19,15 @@ import { readLocalOptions } from './utils/local-options'
19
19
20
20
export async function enableModule ( options : ModuleOptions , nuxt : Nuxt ) {
21
21
// Disable in test mode
22
- if ( process . env . TEST || process . env . NODE_ENV === 'test' )
22
+ if ( process . env . TEST || process . env . NODE_ENV === 'test' || nuxt . options . test )
23
23
return
24
24
25
25
if ( nuxt . options . builder !== '@nuxt/vite-builder' ) {
26
26
logger . warn ( 'Nuxt DevTools only supports Vite mode, module is disabled.' )
27
27
return
28
28
}
29
29
30
- if ( ! nuxt . options . dev || nuxt . options . test ) {
30
+ if ( ! nuxt . options . dev ) {
31
31
if ( nuxt . options . build . analyze )
32
32
await import ( './integrations/analyze-build' ) . then ( ( { setup } ) => setup ( nuxt , options ) )
33
33
return
@@ -178,14 +178,15 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
178
178
} )
179
179
} )
180
180
181
+ await import ( './integrations/plugin-metrics' ) . then ( ( { setup } ) => setup ( ctx ) )
182
+
183
+ if ( options . viteInspect !== false )
184
+ await import ( './integrations/vite-inspect' ) . then ( ( { setup } ) => setup ( ctx ) )
185
+
186
+ if ( options . componentInspector !== false )
187
+ await import ( './integrations/vue-inspector' ) . then ( ( { setup } ) => setup ( ctx ) )
188
+
181
189
const integrations = [
182
- import ( './integrations/plugin-metrics' ) . then ( ( { setup } ) => setup ( ctx ) ) ,
183
- options . viteInspect !== false
184
- ? import ( './integrations/vite-inspect' ) . then ( ( { setup } ) => setup ( ctx ) )
185
- : null ,
186
- options . componentInspector !== false
187
- ? import ( './integrations/vue-inspector' ) . then ( ( { setup } ) => setup ( ctx ) )
188
- : null ,
189
190
options . vscode ?. enabled
190
191
? import ( './integrations/vscode' ) . then ( ( { setup } ) => setup ( ctx ) )
191
192
: null ,
0 commit comments