Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
refactor: rename to nitro:template:document for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 14, 2021
1 parent 8a9e6c5 commit ea09451
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/kit/src/types/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface NuxtHooks {
'builder:watch': (event: WatchEvent, path: string) => HookResult

// @nuxt/nitro
'nitro:template': (template: { src: string, contents: string }) => HookResult
'nitro:template:document': (template: { src: string, contents: string }) => HookResult

// @nuxt/cli
'cli:buildError': (error: unknown) => HookResult
Expand Down
4 changes: 2 additions & 2 deletions packages/nitro/src/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export default function nuxt2CompatModule () {
// Connect hooks
nuxt.addHooks(nitroContext.nuxtHooks)
nuxt.hook('close', () => nitroContext._internal.hooks.callHook('close'))
nitroContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template', template))
nitroContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template:document', template))

nuxt.addHooks(nitroDevContext.nuxtHooks)
nuxt.hook('close', () => nitroDevContext._internal.hooks.callHook('close'))
nitroDevContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template', template))
nitroDevContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template:document', template))
nitroDevContext._internal.hooks.hook('renderLoading',
(req, res) => nuxt.callHook('server:nuxt:renderLoading', req, res))

Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt3/src/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export function initNitro (nuxt: Nuxt) {
// @ts-ignore
nuxt.hooks.addHooks(nitroContext.nuxtHooks)
nuxt.hook('close', () => nitroContext._internal.hooks.callHook('close'))
nitroContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template', template))
nitroContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template:document', template))

// @ts-ignore
nuxt.hooks.addHooks(nitroDevContext.nuxtHooks)
nuxt.hook('close', () => nitroDevContext._internal.hooks.callHook('close'))
nitroDevContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template', template))
nitroDevContext._internal.hooks.hook('nitro:template:document', template => nuxt.callHook('nitro:template:document', template))

// Expose process.env.NITRO_PRESET
nuxt.options.env.NITRO_PRESET = nitroContext.preset
Expand Down

0 comments on commit ea09451

Please sign in to comment.