mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
feat(nuxt): add @nuxt/devtools
as dependency and enable (#23576)
This commit is contained in:
parent
eb40409f23
commit
598e8c2cd0
@ -53,6 +53,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/devalue": "^2.0.2",
|
||||
"@nuxt/devtools": "1.0.0-beta.1",
|
||||
"@nuxt/kit": "workspace:*",
|
||||
"@nuxt/schema": "workspace:*",
|
||||
"@nuxt/telemetry": "^2.5.2",
|
||||
|
@ -441,15 +441,16 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
||||
options.appDir = options.alias['#app'] = resolve(distDir, 'app')
|
||||
options._majorVersion = 3
|
||||
|
||||
// Nuxt DevTools is currently opt-in
|
||||
if (options.devtools === true || (options.devtools && options.devtools.enabled !== false)) {
|
||||
if (await import('./features').then(r => r.ensurePackageInstalled('@nuxt/devtools', {
|
||||
rootDir: options.rootDir,
|
||||
searchPaths: options.modulesDir
|
||||
}))) {
|
||||
options._modules.push('@nuxt/devtools')
|
||||
} else {
|
||||
logger.warn('Failed to install `@nuxt/devtools`, please install it manually, or disable `devtools` in `nuxt.config`')
|
||||
// Nuxt DevTools only works for Vite
|
||||
if (options.builder === '@nuxt/vite-builder') {
|
||||
const isDevToolsEnabled = typeof options.devtools === 'boolean'
|
||||
? options.devtools
|
||||
: options.devtools?.enabled !== false // enabled by default unless explicitly disabled
|
||||
|
||||
if (isDevToolsEnabled) {
|
||||
if (!options._modules.some(m => m === '@nuxt/devtools' || m === '@nuxt/devtools-edge')) {
|
||||
options._modules.push('@nuxt/devtools')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,11 +60,9 @@ export default defineUntypedSchema({
|
||||
/**
|
||||
* Enable Nuxt DevTools for development.
|
||||
*
|
||||
* This is an experimental feature.
|
||||
* Breaking changes for devtools might not reflect on the version of Nuxt.
|
||||
* @see [Nuxt DevTools](https://devtools.nuxtjs.org/) for more information.
|
||||
* @experimental
|
||||
* @type {boolean | { enabled: boolean, [key: string]: any }}
|
||||
* @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information.
|
||||
* @type { { enabled: boolean, [key: string]: any } }
|
||||
*/
|
||||
devtools: false
|
||||
devtools: {}
|
||||
})
|
||||
|
1302
pnpm-lock.yaml
1302
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user