mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
fix(bridge): respect custom app.html
(#2339)
This commit is contained in:
parent
5ab18162dd
commit
279bfdc5b3
@ -43,6 +43,14 @@ export function setupNitroBridge () {
|
|||||||
nuxt.hook('close', () => nitroDevContext._internal.hooks.callHook('close'))
|
nuxt.hook('close', () => nitroDevContext._internal.hooks.callHook('close'))
|
||||||
nitroDevContext._internal.hooks.hook('nitro:document', template => nuxt.callHook('nitro:document', template))
|
nitroDevContext._internal.hooks.hook('nitro:document', template => nuxt.callHook('nitro:document', template))
|
||||||
|
|
||||||
|
// Use custom document template if provided
|
||||||
|
if (nuxt.options.appTemplatePath) {
|
||||||
|
nuxt.hook('nitro:document', async (template) => {
|
||||||
|
template.src = nuxt.options.appTemplatePath
|
||||||
|
template.contents = await fsp.readFile(nuxt.options.appTemplatePath, 'utf-8')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Expose process.env.NITRO_PRESET
|
// Expose process.env.NITRO_PRESET
|
||||||
nuxt.options.env.NITRO_PRESET = nitroContext.preset
|
nuxt.options.env.NITRO_PRESET = nitroContext.preset
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user