mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
fix(templates): export types in dev mode
This commit is contained in:
@@ -68,8 +68,8 @@ export function addTemplates(options: ModuleOptions, nuxt: Nuxt) {
|
|||||||
return [
|
return [
|
||||||
`import template from ${JSON.stringify(fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url)))}`,
|
`import template from ${JSON.stringify(fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url)))}`,
|
||||||
`const result = typeof template === 'function' ? template(${JSON.stringify(options)}) : template`,
|
`const result = typeof template === 'function' ? template(${JSON.stringify(options)}) : template`,
|
||||||
`export default result`,
|
`const json = ${json}`,
|
||||||
`/* export default ${json} */`
|
`export default result as typeof json`
|
||||||
].join('\n')
|
].join('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user