mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 10:54:49 +00:00
13 lines
326 B
TypeScript
13 lines
326 B
TypeScript
|
import type { NuxtHooks } from '@nuxt/schema'
|
||
|
import { useNuxt } from './context'
|
||
|
import { isNuxt2 } from './compatibility'
|
||
|
|
||
|
export function extendPages (cb: NuxtHooks['pages:extend']) {
|
||
|
const nuxt = useNuxt()
|
||
|
if (isNuxt2(nuxt)) {
|
||
|
nuxt.hook('build:extendRoutes', cb)
|
||
|
} else {
|
||
|
nuxt.hook('pages:extend', cb)
|
||
|
}
|
||
|
}
|