diff --git a/src/module.ts b/src/module.ts index 6687e494c..a08431a52 100644 --- a/src/module.ts +++ b/src/module.ts @@ -239,7 +239,10 @@ export default defineNuxtModule({ }).dst addImports([{ name: '_refreshHandler', - from: generatedRefreshHandlerPath + // Drop the `.ts` so every Nuxt command writes the same import path. Otherwise + // `dev`/`prepare` keep it and `typecheck` drops it, which rewrites imports.d.ts + // and invalidates the vue-tsc cache on each switch. + from: generatedRefreshHandlerPath.replace(TS_ENDS_RE, '') }]) // 6. Register middleware for autocomplete in definePageMeta