@@ -5,7 +5,7 @@ import type { ModuleOptions, NuxtDevToolsOptions } from './types'
55import { existsSync } from 'node:fs'
66import fs from 'node:fs/promises'
77import os from 'node:os'
8- import { addPlugin , addTemplate , addVitePlugin , logger } from '@nuxt/kit'
8+ import { addImports , addPlugin , addTemplate , addVitePlugin , extendViteConfig , logger } from '@nuxt/kit'
99import { colors } from 'consola/utils'
1010import { join } from 'pathe'
1111import sirv from 'sirv'
@@ -110,7 +110,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
110110
111111 const clientDirExists = existsSync ( clientDir )
112112
113- nuxt . hook ( 'vite:extendConfig' , ( config ) => {
113+ extendViteConfig ( ( config ) => {
114114 config . server ||= { }
115115 config . server . fs ||= { }
116116 config . server . fs . allow ||= [
@@ -126,11 +126,9 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
126126 config . server . watch . ignored . push ( '**/.cache/nuxt-devtools/**' )
127127 } )
128128
129- nuxt . hook ( 'imports:extend' , ( imports ) => {
130- imports . push ( {
131- name : 'useNuxtDevTools' ,
132- from : join ( runtimeDir , 'use-nuxt-devtools' ) ,
133- } )
129+ addImports ( {
130+ name : 'useNuxtDevTools' ,
131+ from : join ( runtimeDir , 'use-nuxt-devtools' ) ,
134132 } )
135133
136134 const ROUTE_PATH = `${ nuxt . options . app . baseURL || '/' } /__nuxt_devtools__` . replace ( / \/ + / g, '/' )
0 commit comments