We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f6ceec commit 84a8419Copy full SHA for 84a8419
1 file changed
packages/bridge/module.cjs
@@ -40,6 +40,17 @@ module.exports.defineNuxtConfig = (config = {}) => {
40
}
41
nuxtCtx.set(nuxt)
42
43
+ // Mock new hookable methods
44
+ nuxt.removeHook ||= nuxt.clearHook.bind(nuxt)
45
+ nuxt.removeAllHooks ||= nuxt.clearHooks.bind(nuxt)
46
+ nuxt.hookOnce ||= (name, fn, ...hookArgs) => {
47
+ const unsub = nuxt.hook(name, (...args) => {
48
+ unsub()
49
+ return fn(...args)
50
+ }, ...hookArgs)
51
+ return unsub
52
+ }
53
+
54
// Mock _layers for nitro and auto-imports
55
nuxt.options._layers = nuxt.options._layers || [{
56
config: nuxt.options,
0 commit comments