mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-23 03:42:37 +00:00
fix(kit)!: do not check compatibility for nuxt version < 2.13
This commit is contained in:
parent
6abefd3ee6
commit
f94cda4c80
@ -1,7 +1,6 @@
|
||||
import { kebabCase, pascalCase } from 'scule'
|
||||
import type { Component, ComponentsDir } from '@nuxt/schema'
|
||||
import { useNuxt } from './context'
|
||||
import { checkNuxtVersion } from './compatibility'
|
||||
import { logger } from './logger'
|
||||
import { MODE_RE } from './utils'
|
||||
|
||||
@ -10,9 +9,6 @@ import { MODE_RE } from './utils'
|
||||
*/
|
||||
export function addComponentsDir (dir: ComponentsDir, opts: { prepend?: boolean } = {}) {
|
||||
const nuxt = useNuxt()
|
||||
if (!checkNuxtVersion('>=2.13', nuxt)) {
|
||||
throw new Error(`\`addComponentsDir\` requires Nuxt 2.13 or higher.`)
|
||||
}
|
||||
nuxt.options.components ||= []
|
||||
dir.priority ||= 0
|
||||
nuxt.hook('components:dirs', (dirs) => { dirs[opts.prepend ? 'unshift' : 'push'](dir) })
|
||||
@ -27,10 +23,6 @@ export type AddComponentOptions = { name: string, filePath: string } & Partial<E
|
||||
*/
|
||||
export function addComponent (opts: AddComponentOptions) {
|
||||
const nuxt = useNuxt()
|
||||
if (!checkNuxtVersion('>=2.13', nuxt)) {
|
||||
throw new Error(`\`addComponent\` requires Nuxt 2.13 or higher.`)
|
||||
}
|
||||
|
||||
nuxt.options.components ||= []
|
||||
|
||||
if (!opts.mode) {
|
||||
|
Loading…
Reference in New Issue
Block a user