mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-20 07:30:57 +00:00
fix(nuxt): do not try auto-install outside of a Nuxt context (#24605)
This commit is contained in:
parent
1e393ad696
commit
445fe808c0
@ -5,7 +5,7 @@ import { pascalCase } from 'scule'
|
||||
import { resolve } from 'pathe'
|
||||
import type { Component, ComponentsOptions } from 'nuxt/schema'
|
||||
|
||||
import { logger } from '@nuxt/kit'
|
||||
import { logger, tryUseNuxt } from '@nuxt/kit'
|
||||
import { distDir } from '../dirs'
|
||||
import { isVue } from '../core/utils'
|
||||
|
||||
@ -47,7 +47,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
|
||||
const component = findComponent(components, name, options.mode)
|
||||
if (component) {
|
||||
// @ts-expect-error TODO: refactor to nuxi
|
||||
if (component._internal_install) {
|
||||
if (component._internal_install && tryUseNuxt()?.options.test === false) {
|
||||
// @ts-expect-error TODO: refactor to nuxi
|
||||
import('../core/features').then(({ installNuxtModule }) => installNuxtModule(component._internal_install))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user