@@ -5,7 +5,7 @@ import type { ModuleOptions, NuxtDevToolsOptions } from './types'
|
5 | 5 | import { existsSync } from 'node:fs' |
6 | 6 | import fs from 'node:fs/promises' |
7 | 7 | import os from 'node:os' |
8 | | -import { addPlugin, addTemplate, addVitePlugin, logger } from '@nuxt/kit' |
| 8 | +import { addImports, addPlugin, addTemplate, addVitePlugin, extendViteConfig, logger } from '@nuxt/kit' |
9 | 9 | import { colors } from 'consola/utils' |
10 | 10 | import { join } from 'pathe' |
11 | 11 | import sirv from 'sirv' |
@@ -110,7 +110,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
110 | 110 | |
111 | 111 | const clientDirExists = existsSync(clientDir) |
112 | 112 | |
113 | | -nuxt.hook('vite:extendConfig', (config) => { |
| 113 | +extendViteConfig((config) => { |
114 | 114 | config.server ||= {} |
115 | 115 | config.server.fs ||= {} |
116 | 116 | config.server.fs.allow ||= [ |
@@ -126,11 +126,9 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
126 | 126 | config.server.watch.ignored.push('**/.cache/nuxt-devtools/**') |
127 | 127 | }) |
128 | 128 | |
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'), |
134 | 132 | }) |
135 | 133 | |
136 | 134 | const ROUTE_PATH = `${nuxt.options.app.baseURL || '/'}/__nuxt_devtools__`.replace(/\/+/g, '/') |
|