From fcbc4f8240f77f570fe4d17b1c49e96bc8d0d8b5 Mon Sep 17 00:00:00 2001 From: EpicPlayerA10 Date: Wed, 15 May 2024 16:27:43 +0200 Subject: [PATCH] Fix HMR on windows --- src/module.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/module.ts b/src/module.ts index 05165a5..128fb36 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,4 +1,4 @@ -import { relative, resolve } from 'node:path' +import { relative, resolve, normalize } from 'node:path' import { existsSync, statSync } from 'fs' import { defu } from 'defu' import { upperFirst } from 'scule' @@ -167,7 +167,9 @@ export default defineNuxtModule({ async function generateGqlTypes (hmrDoc?: string) { const documents: string[] = [] for await (const path of documentPaths) { - const files = (await resolveFiles(path, [gqlMatch, '!**/schemas'], { followSymbolicLinks: false })).filter(allowDocument) + const files = (await resolveFiles(path, [gqlMatch, '!**/schemas'], { followSymbolicLinks: false })) + .filter(allowDocument) + .map(file => normalize(file)) documents.push(...files) }