Add JavaScript Libraries from npm to Nuxt

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

You can install libraries from npm as usual, but you need to be aware of the vendor property of your nuxt.config.js so that the library only gets loaded once with your application. This lesson walks you through the appropriate steps of adding axios to your project and setting it up as a vendor library in your nuxt.config.js.

Victor Hazbun
~ 7 years ago

You should explain the asyncData function, not everybody here understands why it worked even when you did not called the function directly, here is the docs if someone else feels confused about it: https://nuxtjs.org/api/