Skip to content

Commit 6f7627d

Browse files
committed
fix: await resolveSchema (now async)
1 parent bc59ae8 commit 6f7627d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/type-templates.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface TemplateContext {
3333
const adHocModules = ['router', 'pages', 'auto-imports', 'meta', 'components']
3434
export const schemaTemplate = {
3535
filename: 'types/schema.d.ts',
36-
getContents: ({ nuxt }: TemplateContext) => {
36+
getContents: async ({ nuxt }: TemplateContext) => {
3737
const moduleInfo = nuxt.options._installedModules.map(m => ({
3838
...m.meta || {},
3939
importName: m.entryPath || m.meta?.name
@@ -44,10 +44,10 @@ export const schemaTemplate = {
4444
"declare module '@nuxt/schema' {",
4545
' interface NuxtConfig {',
4646
...moduleInfo.filter(Boolean).map(meta =>
47-
` [${genString(meta.configKey)}]?: typeof ${genDynamicImport(meta.importName, { wrapper: false })}.default extends NuxtModule<infer O> ? Partial<O> : Record<string, any>`
47+
` [${genString(meta.configKey)}]?: typeof ${genDynamicImport(meta.importName, { wrapper: false })}.default extends NuxtModule<infer O> ? Partial<O> : Record<string, any>`
4848
),
4949
' }',
50-
generateTypes(resolveSchema(nuxt.options.runtimeConfig),
50+
generateTypes(await resolveSchema(nuxt.options.runtimeConfig),
5151
{
5252
interfaceName: 'RuntimeConfig',
5353
addExport: false,

0 commit comments

Comments
 (0)