Skip to content

Commit

Permalink
feat(typescript): add vueCompilerOptions key to tsConfig in defineNux…
Browse files Browse the repository at this point in the history
…tConfig
  • Loading branch information
Evobaso-J committed Feb 22, 2024
1 parent ad6f4fb commit 726ab6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/schema/src/config/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineUntypedSchema({

/**
* You can extend generated `.nuxt/tsconfig.json` using this option.
* @type {typeof import('pkg-types')['TSConfig']}
* @type {typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: typeof import('@vue/language-core')['VueCompilerOptions']}}
*/
tsConfig: {},

Expand Down
6 changes: 5 additions & 1 deletion packages/schema/src/types/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { Compiler, Configuration, Stats } from 'webpack'
import type { Nitro, NitroConfig } from 'nitropack'
import type { Schema, SchemaDefinition } from 'untyped'
import type { RouteLocationRaw } from 'vue-router'
import type { VueCompilerOptions } from '@vue/language-core'
import type { NuxtCompatibility, NuxtCompatibilityIssues, ViteConfig } from '..'
import type { Component, ComponentsOptions } from './components'
import type { Nuxt, NuxtApp, ResolvedNuxtTemplate } from './nuxt'
Expand All @@ -19,6 +20,9 @@ export type HookResult = Promise<void> | void
export type TSReference = { types: string } | { path: string }

export type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
export type VueTSConfig = TSConfig & {
vueCompilerOptions?: VueCompilerOptions;
};

export type NuxtPage = {
name?: string
Expand Down Expand Up @@ -273,7 +277,7 @@ export interface NuxtHooks {
* @param options Objects containing `references`, `declarations`, `tsConfig`
* @returns Promise
*/
'prepare:types': (options: { references: TSReference[], declarations: string[], tsConfig: TSConfig }) => HookResult
'prepare:types': (options: { references: TSReference[], declarations: string[], tsConfig: VueTSConfig }) => HookResult
/**
* Called when the dev server is loading.
* @param listenerServer The HTTP/HTTPS server object
Expand Down

0 comments on commit 726ab6e

Please sign in to comment.