@@ -19,15 +19,15 @@ import { readLocalOptions } from './utils/local-options'
1919
2020export async function enableModule ( options : ModuleOptions , nuxt : Nuxt ) {
2121 // 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 )
2323 return
2424
2525 if ( nuxt . options . builder !== '@nuxt/vite-builder' ) {
2626 logger . warn ( 'Nuxt DevTools only supports Vite mode, module is disabled.' )
2727 return
2828 }
2929
30- if ( ! nuxt . options . dev || nuxt . options . test ) {
30+ if ( ! nuxt . options . dev ) {
3131 if ( nuxt . options . build . analyze )
3232 await import ( './integrations/analyze-build' ) . then ( ( { setup } ) => setup ( nuxt , options ) )
3333 return
@@ -178,14 +178,15 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
178178 } )
179179 } )
180180
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+
181189 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 ,
189190 options . vscode ?. enabled
190191 ? import ( './integrations/vscode' ) . then ( ( { setup } ) => setup ( ctx ) )
191192 : null ,
0 commit comments