From f94cda4c80c4b2369d3d60c6f5a056302fcc7f59 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 21 Jan 2025 14:53:09 +0000 Subject: [PATCH] fix(kit)!: do not check compatibility for nuxt version < 2.13 --- packages/kit/src/components.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/kit/src/components.ts b/packages/kit/src/components.ts index 79088591b0..3b8e441767 100644 --- a/packages/kit/src/components.ts +++ b/packages/kit/src/components.ts @@ -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=2.13', nuxt)) { - throw new Error(`\`addComponent\` requires Nuxt 2.13 or higher.`) - } - nuxt.options.components ||= [] if (!opts.mode) {