From 1eaec0ff568bcdff78a0aae0fa824f8b7d1c63e6 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 2 Jul 2024 13:45:43 +0200 Subject: [PATCH] fix(templates): export types in dev mode --- src/templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates.ts b/src/templates.ts index c1971232..d2acf5c2 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -68,8 +68,8 @@ export function addTemplates(options: ModuleOptions, nuxt: Nuxt) { return [ `import template from ${JSON.stringify(fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url)))}`, `const result = typeof template === 'function' ? template(${JSON.stringify(options)}) : template`, - `export default result`, - `/* export default ${json} */` + `const json = ${json}`, + `export default result as typeof json` ].join('\n') }