From the course: Learning Nuxt.js
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
What are Nuxt plug-ins?
From the course: Learning Nuxt.js
What are Nuxt plug-ins?
- [Instructor] There are times when we need to extend the functionality of our app and one way to do this in Nuxt is by using a Nuxt plugin. Nuxt plugins are transcript files that you run before instantiating the roots of Vue application. This means that any plugin you create will be imported before the main application starts running. Nuxt has three different ways you can use a plugin. You can use it by injecting it in the root or context of your app, you can use it with third party libraries as a Vue plugin and you can use it to extend an external package or a module you use in your application. Let's see how the different ways of using a plugin work. First, by default, Nuxt does not include the plugin directory, so you would need to create one. Inside a plugin directory is where you add the JavaScript files needed to run a plugin and Nuxt will automatically load them before the application starts running. We have the…