Skip to content

Commit bab31d1

Browse files
feat: ensure directories are created before writing client type files
1 parent 43e05dd commit bab31d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/type-generation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ export async function clientTypeGeneration(
9898
}
9999
const clientTypesPath = resolve(nitro.options.buildDir, 'types', 'nitro-graphql-client.d.ts')
100100
const sdkTypesPath = resolve(nitro.graphql.clientDir, 'sdk.ts')
101+
mkdirSync(dirname(clientTypesPath), { recursive: true })
101102
writeFileSync(clientTypesPath, types.types, 'utf-8')
103+
mkdirSync(dirname(sdkTypesPath), { recursive: true })
102104
writeFileSync(sdkTypesPath, types.sdk, 'utf-8')
103105

104106
// Generate ofetch client for Nuxt framework

0 commit comments

Comments
 (0)