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": {
|
"dependencies": {
|
||||||
"@nuxt/devalue": "^2.0.2",
|
"@nuxt/devalue": "^2.0.2",
|
||||||
|
"@nuxt/devtools": "1.0.0-beta.1",
|
||||||
"@nuxt/kit": "workspace:*",
|
"@nuxt/kit": "workspace:*",
|
||||||
"@nuxt/schema": "workspace:*",
|
"@nuxt/schema": "workspace:*",
|
||||||
"@nuxt/telemetry": "^2.5.2",
|
"@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.appDir = options.alias['#app'] = resolve(distDir, 'app')
|
||||||
options._majorVersion = 3
|
options._majorVersion = 3
|
||||||
|
|
||||||
// Nuxt DevTools is currently opt-in
|
// Nuxt DevTools only works for Vite
|
||||||
if (options.devtools === true || (options.devtools && options.devtools.enabled !== false)) {
|
if (options.builder === '@nuxt/vite-builder') {
|
||||||
if (await import('./features').then(r => r.ensurePackageInstalled('@nuxt/devtools', {
|
const isDevToolsEnabled = typeof options.devtools === 'boolean'
|
||||||
rootDir: options.rootDir,
|
? options.devtools
|
||||||
searchPaths: options.modulesDir
|
: options.devtools?.enabled !== false // enabled by default unless explicitly disabled
|
||||||
}))) {
|
|
||||||
options._modules.push('@nuxt/devtools')
|
if (isDevToolsEnabled) {
|
||||||
} else {
|
if (!options._modules.some(m => m === '@nuxt/devtools' || m === '@nuxt/devtools-edge')) {
|
||||||
logger.warn('Failed to install `@nuxt/devtools`, please install it manually, or disable `devtools` in `nuxt.config`')
|
options._modules.push('@nuxt/devtools')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,11 +60,9 @@ export default defineUntypedSchema({
|
|||||||
/**
|
/**
|
||||||
* Enable Nuxt DevTools for development.
|
* Enable Nuxt DevTools for development.
|
||||||
*
|
*
|
||||||
* This is an experimental feature.
|
|
||||||
* Breaking changes for devtools might not reflect on the version of Nuxt.
|
* Breaking changes for devtools might not reflect on the version of Nuxt.
|
||||||
* @see [Nuxt DevTools](https://devtools.nuxtjs.org/) for more information.
|
* @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information.
|
||||||
* @experimental
|
* @type { { enabled: boolean, [key: string]: any } }
|
||||||
* @type {boolean | { 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