mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): improve types within plugin templates (#22998)
This commit is contained in:
parent
5f176b1a96
commit
8ced37bc8b
@ -114,11 +114,11 @@ export default defineNuxtModule<ComponentsOptions>({
|
||||
})
|
||||
|
||||
// components.d.ts
|
||||
addTemplate({ ...componentsTypeTemplate })
|
||||
addTemplate(componentsTypeTemplate)
|
||||
// components.plugin.mjs
|
||||
addPluginTemplate({ ...componentsPluginTemplate } as any)
|
||||
addPluginTemplate(componentsPluginTemplate)
|
||||
// component-names.mjs
|
||||
addTemplate({ ...componentNamesTemplate, options: { mode: 'all' } })
|
||||
addTemplate(componentNamesTemplate)
|
||||
// components.islands.mjs
|
||||
if (nuxt.options.experimental.componentIslands) {
|
||||
addTemplate({ ...componentsIslandsTemplate, filename: 'components.islands.mjs' })
|
||||
|
@ -33,7 +33,7 @@ export default defineNuxtPlugin({
|
||||
})
|
||||
`
|
||||
|
||||
export const componentsPluginTemplate: NuxtPluginTemplate<ComponentsTemplateContext> = {
|
||||
export const componentsPluginTemplate: NuxtPluginTemplate = {
|
||||
filename: 'components.plugin.mjs',
|
||||
getContents ({ app }) {
|
||||
const lazyGlobalComponents = new Set<string>()
|
||||
@ -70,7 +70,7 @@ export default defineNuxtPlugin({
|
||||
}
|
||||
}
|
||||
|
||||
export const componentNamesTemplate: NuxtPluginTemplate<ComponentsTemplateContext> = {
|
||||
export const componentNamesTemplate: NuxtTemplate<ComponentsTemplateContext> = {
|
||||
filename: 'component-names.mjs',
|
||||
getContents ({ app }) {
|
||||
return `export const componentNames = ${JSON.stringify(app.components.filter(c => !c.island).map(c => c.pascalName))}`
|
||||
|
Loading…
Reference in New Issue
Block a user