diff --git a/packages/nuxt/src/core/nuxt.ts b/packages/nuxt/src/core/nuxt.ts index 638fd6a29b..ee55729ca0 100644 --- a/packages/nuxt/src/core/nuxt.ts +++ b/packages/nuxt/src/core/nuxt.ts @@ -358,6 +358,17 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise { // 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 { 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) {