fix(templates): include .d.mts declarations

This commit is contained in:
Daniel Roe 2024-04-05 13:43:04 +01:00
parent 6129711802
commit 1086bf0018

View File

@ -146,6 +146,7 @@ export const RenderPlugin = () => {
// Write new template // Write new template
await fsp.writeFile(fileName.replace('/index.html', '.mjs'), `${jsCode}\nexport const template = _template`) await fsp.writeFile(fileName.replace('/index.html', '.mjs'), `${jsCode}\nexport const template = _template`)
await fsp.writeFile(fileName.replace('/index.html', '.vue'), vueCode) await fsp.writeFile(fileName.replace('/index.html', '.vue'), vueCode)
await fsp.writeFile(fileName.replace('/index.html', '.d.mts'), `${types}`)
await fsp.writeFile(fileName.replace('/index.html', '.d.ts'), `${types}`) await fsp.writeFile(fileName.replace('/index.html', '.d.ts'), `${types}`)
// Remove original html file // Remove original html file
@ -158,6 +159,7 @@ export const RenderPlugin = () => {
await fsp.writeFile(r('dist/index.mjs'), contents, 'utf8') await fsp.writeFile(r('dist/index.mjs'), contents, 'utf8')
await fsp.writeFile(r('dist/index.d.ts'), replaceAll(contents, /\.mjs/g, ''), 'utf8') await fsp.writeFile(r('dist/index.d.ts'), replaceAll(contents, /\.mjs/g, ''), 'utf8')
await fsp.writeFile(r('dist/index.d.mts'), replaceAll(contents, /\.mjs/g, ''), 'utf8')
} }
} }
} }