mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxt): add @nuxt/devtools
module before core modules (#20595)
This commit is contained in:
parent
9b956c9689
commit
a13b18eddf
@ -358,6 +358,17 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
||||
// Temporary until finding better placement for each
|
||||
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(options.rootDir, '@nuxt/devtools', 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`')
|
||||
}
|
||||
}
|
||||
|
||||
// Add core modules
|
||||
options._modules.push(pagesModule, metaModule, componentsModule)
|
||||
options._modules.push([importsModule, {
|
||||
transform: {
|
||||
@ -376,15 +387,6 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
||||
options._modules.push('@nuxt/telemetry')
|
||||
}
|
||||
|
||||
// Nuxt DevTools is currently opt-in
|
||||
if (options.devtools === true || (options.devtools && options.devtools.enabled !== false)) {
|
||||
if (await import('./features').then(r => r.ensurePackageInstalled(options.rootDir, '@nuxt/devtools', 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`')
|
||||
}
|
||||
}
|
||||
|
||||
const nuxt = createNuxt(options)
|
||||
|
||||
if (nuxt.options.debug) {
|
||||
|
Loading…
Reference in New Issue
Block a user