From 583679f9c808cba791ea72e9db36efa19067c919 Mon Sep 17 00:00:00 2001 From: Nozomu Ikuta Date: Sun, 21 Nov 2021 21:35:37 +0900 Subject: [PATCH] fix(kit): add hooks installation for bridge (#2045) Co-authored-by: Pooya Parsa --- packages/kit/src/module/define.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/kit/src/module/define.ts b/packages/kit/src/module/define.ts index 8229025156..7ceaf86706 100644 --- a/packages/kit/src/module/define.ts +++ b/packages/kit/src/module/define.ts @@ -28,7 +28,11 @@ export function defineNuxtModule (input: NuxtMod // Install hooks if (mod.hooks) { - nuxt.hooks.addHooks(mod.hooks) + if (isNuxt2(nuxt)) { + nuxt.addHooks(mod.hooks) + } else { + nuxt.hooks.addHooks(mod.hooks) + } } // Stop if no install provided