mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-19 16:01:24 +00:00
fix(schema): use RawVueCompilerOptions
for unresolved tsconfig
(#31202)
This commit is contained in:
parent
903597a48d
commit
86520bd0ec
@ -84,7 +84,7 @@ export default defineResolvers({
|
||||
|
||||
/**
|
||||
* You can extend generated `.nuxt/tsconfig.json` using this option.
|
||||
* @type {0 extends 1 & VueCompilerOptions ? typeof import('pkg-types')['TSConfig'] : typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: Omit<typeof import('@vue/language-core')['VueCompilerOptions'], 'plugins'> & { plugins?: string[] } }}
|
||||
* @type {0 extends 1 & RawVueCompilerOptions ? typeof import('pkg-types')['TSConfig'] : typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: typeof import('@vue/language-core')['RawVueCompilerOptions'] }}
|
||||
*/
|
||||
tsConfig: {},
|
||||
|
||||
|
@ -9,7 +9,7 @@ import type { Compiler, Configuration, Stats } from 'webpack'
|
||||
import type { Nitro, NitroConfig } from 'nitropack'
|
||||
import type { Schema, SchemaDefinition } from 'untyped'
|
||||
import type { RouteLocationRaw, RouteRecordRaw } from 'vue-router'
|
||||
import type { VueCompilerOptions } from '@vue/language-core'
|
||||
import type { RawVueCompilerOptions } from '@vue/language-core'
|
||||
import type { NuxtCompatibility, NuxtCompatibilityIssues, ViteConfig } from '..'
|
||||
import type { Component, ComponentsOptions } from './components'
|
||||
import type { Nuxt, NuxtApp, ResolvedNuxtTemplate } from './nuxt'
|
||||
@ -21,9 +21,9 @@ export type TSReference = { types: string } | { path: string }
|
||||
|
||||
export type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
|
||||
|
||||
// If the user does not have `@vue/language-core` installed, VueCompilerOptions will be typed as `any`,
|
||||
// thus making the whole `VueTSConfig` type `any`. We only augment TSConfig if VueCompilerOptions is available.
|
||||
export type VueTSConfig = 0 extends 1 & VueCompilerOptions ? TSConfig : TSConfig & { vueCompilerOptions?: Omit<VueCompilerOptions, 'plugins'> & { plugins?: string[] } }
|
||||
// If the user does not have `@vue/language-core` installed, RawVueCompilerOptions will be typed as `any`,
|
||||
// thus making the whole `VueTSConfig` type `any`. We only augment TSConfig if RawVueCompilerOptions is available.
|
||||
export type VueTSConfig = 0 extends 1 & RawVueCompilerOptions ? TSConfig : TSConfig & { vueCompilerOptions?: RawVueCompilerOptions }
|
||||
|
||||
export type NuxtPage = {
|
||||
name?: string
|
||||
|
Loading…
Reference in New Issue
Block a user