-
Related to this discussion, I'm using a
All works well while running
I tried to change it to a plugin by doing:
The action executes, but too late. I also tried other hooks like What would be the correct way to do this in Nuxt Bridge? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solution was to rename the file to
and add it to the plugins object in
Then no need for a hook as it executes on server side
|
Beta Was this translation helpful? Give feedback.
Solution was to rename the file to
plugins/01.init.server.ts
and add it to the plugins object in
nuxt.config.ts
(very important, if not it doesn't work)plugins: [{ src: '~/plugins/01.init.server' }],
Then no need for a hook as it executes on server side