question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt 2: Deactivate/Activate Plugin for certain pages

See original GitHub issue

I would like to activate the plugin only for certain pages.

Best would be to enable or disable it inside the export default {} of the pages, or by having a function in the nuxt.config settings that return the pages for which the plugin should be activated.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
harlan-zwcommented, Dec 8, 2022

Thanks for letting me know, I chose not to include this for Nuxt v2 due to the effort involved.

I’ve re-opened the issue as I may re-consider it, but at this stage, I have other priorities to work on sorry.

1reaction
Fabionicommented, Dec 8, 2022

Same here. I am only using nuxt-2

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I turn off SSR for only certain pages in Nuxt.js to use ...
You could do that via server middleware export default function(req, res, next) { const paths = ['/', '/a'] if (paths.includes(req.
Read more >
Configuration - Nuxt
Nuxt lets you define the CSS files/modules/libraries you want to set globally (included in every page). In case you want to use sass...
Read more >
Nuxt configuration file
You can customize the path by using --dotenv <file> or disable entirely with ... the context in your pages, store, components and plugins...
Read more >
Modules directory - Nuxt
Thanks to Nuxt's modular design (based on webpack's Tapable ), modules can easily register hooks for certain entry points like the builder initialization....
Read more >
Built-in Components - Nuxt
To import a component only on the client, register the component in a client-side only plugin. pages/example.vue <template> <div> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found