fix(nuxt,schema): add types for _installedModules

This commit is contained in:
Daniel Roe 2024-06-13 21:00:11 +01:00
parent 2c5102557a
commit e4bfea6428
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
3 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,7 @@ export async function _generateTypes (nuxt: Nuxt) {
const modulePaths = await resolveNuxtModule(rootDirWithSlash,
nuxt.options._installedModules
.filter(m => m.entryPath)
.map(m => getDirectory(m.entryPath)),
.map(m => getDirectory(m.entryPath!)),
)
const isV4 = nuxt.options.future?.compatibilityVersion === 4

View File

@ -43,7 +43,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
const modules = await resolveNuxtModule(rootDirWithSlash,
nuxt.options._installedModules
.filter(m => m.entryPath)
.map(m => m.entryPath),
.map(m => m.entryPath!),
)
const nitroConfig: NitroConfig = defu(nuxt.options.nitro, {

View File

@ -23,7 +23,10 @@ export default defineUntypedSchema({
_nuxtConfigFiles: [],
/** @private */
appDir: '',
/** @private */
/**
* @private
* @type {Array<{ meta: ModuleMeta; timings?: Record<string, number | undefined>; entryPath?: string }>}
*/
_installedModules: [],
/** @private */
_modules: [],