mirror of https://github.com/nuxt/nuxt.git
fix(nuxt3): add support for custom templates (#225)
This commit is contained in:
parent
e2d5a2f4b3
commit
5c67408191
|
@ -30,6 +30,16 @@ export async function generateApp (nuxt: Nuxt, app: NuxtApp) {
|
||||||
data: {}
|
data: {}
|
||||||
} as NuxtTemplate))
|
} as NuxtTemplate))
|
||||||
|
|
||||||
|
// Custom templates (created with addTemplate)
|
||||||
|
const customTemplates = nuxt.options.build.templates.map(t => ({
|
||||||
|
path: t.dst,
|
||||||
|
src: t.src,
|
||||||
|
data: {
|
||||||
|
options: t.options
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
app.templates = app.templates.concat(customTemplates)
|
||||||
|
|
||||||
// Extend templates
|
// Extend templates
|
||||||
await nuxt.callHook('app:templates', app)
|
await nuxt.callHook('app:templates', app)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue